Skip to content

Commit f87bdfe

Browse files
committed
added logger for log, warn, error message
1 parent 4191702 commit f87bdfe

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/borea_python/config_parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from typing import List, Optional
22

3-
import click
4-
53
from .content_loader import ContentLoader, ContentLoadError
4+
from .logger import Logger
65
from .models.borea_config_models import (
76
BoreaConfig,
87
BoreaConfigJSON,
@@ -109,7 +108,7 @@ def parse_config(cls, config: BoreaConfigJSON) -> BoreaConfig:
109108
@staticmethod
110109
def log_warning_default_config_not_found() -> None:
111110
"""Log a warning message when the default config is not found."""
112-
click.echo(
111+
Logger.warn(
113112
"Warning: No borea.config.json found. Command line arguments or defaults will be used."
114113
)
115114

src/borea_python/logger.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import click
2+
3+
4+
class Logger:
5+
@classmethod
6+
def log(cls, message: str):
7+
click.echo(message)
8+
9+
@classmethod
10+
def warn(cls, message: str):
11+
click.echo(f"WARNING: {message}")
12+
13+
@classmethod
14+
def error(cls, message: str):
15+
click.echo(f"ERROR: {message}")

0 commit comments

Comments
 (0)