Skip to content

Commit

Permalink
hotfix: change level type
Browse files Browse the repository at this point in the history
  • Loading branch information
aslamhadi committed Oct 3, 2023
1 parent 14454fc commit 4c3bfde
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions upils/logging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Module providing custom configuration for loguru"""
import json
import sys
from typing import Union

from loguru import logger

Expand Down Expand Up @@ -32,8 +33,13 @@ def patching(record):
record["extra"]["serialized"] = serialize(record)


def configure_logger(level: str) -> logger:
"""Configuration for custom loguru"""
def configure_logger(level: Union[str, int]) -> logger:
"""
Configuration for custom loguru
:param level: logging level. can be str or int.
https://docs.python.org/3/library/logging.html#logging-levels
"""

# remove default option from loguru. if we don't remove this, it will result in duplicated logs
logger.remove(0)
Expand Down

0 comments on commit 4c3bfde

Please sign in to comment.