This commit is contained in:
parent
6828fe684d
commit
b6e6546bd7
@ -6,9 +6,8 @@ from .singleton import Singleton
|
|||||||
|
|
||||||
class CustomLogger(Singleton):
|
class CustomLogger(Singleton):
|
||||||
"""
|
"""
|
||||||
Singleton logger class that initializes a logger with a specified name and log file.
|
Singleton logger class that initializes a logger with a specified name
|
||||||
It provides a method to log entry and exit of functions.
|
and log file.It provides a method to log entry and exit of functions.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name="main", log_file=None, level=logging.INFO):
|
def __init__(self, name="main", log_file=None, level=logging.INFO):
|
||||||
@ -22,7 +21,8 @@ class CustomLogger(Singleton):
|
|||||||
self.logger.propagate = False
|
self.logger.propagate = False
|
||||||
|
|
||||||
formatter = logging.Formatter(
|
formatter = logging.Formatter(
|
||||||
"%(asctime)s %(levelname)s [%(filename)s:%(lineno)3d]: %(message)s"
|
"%(asctime)s %(levelname)s "
|
||||||
|
"[%(filename)s:%(lineno)3d]: %(message)s"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Console handler
|
# Console handler
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user