Skip to content

Commit

Permalink
configure SIR and tweak logging
Browse files Browse the repository at this point in the history
  • Loading branch information
oelarnes committed Jan 11, 2025
1 parent 076f460 commit badf308
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions spells/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"WOE",
"LTR",
"MOM",
"SIR",
"ONE",
"BRO",
"DMU",
Expand Down
6 changes: 4 additions & 2 deletions spells/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ def console_logging(log_level):
logger.removeHandler(console_handler)


def make_verbose(level: int = logging.ERROR) -> Callable:
def make_verbose(level: int | None = None) -> Callable:
def decorator(func: Callable) -> Callable:
@wraps(func)
def wrapped(*args, log_to_console: int = level, **kwargs):
def wrapped(*args, log_to_console: int | None = level, **kwargs):
if log_to_console is None:
return func(*args, **kwargs)
with console_logging(log_to_console):
return func(*args, **kwargs)

Expand Down

0 comments on commit badf308

Please sign in to comment.