mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
add singleton logging
This commit is contained in:
14
utils/log_utils.py
Normal file
14
utils/log_utils.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from loguru import logger
|
||||
|
||||
|
||||
class SingletonLogger:
|
||||
__instance = None
|
||||
|
||||
@staticmethod
|
||||
def get_logger():
|
||||
if not SingletonLogger.__instance:
|
||||
SingletonLogger.__instance = logger
|
||||
return SingletonLogger.__instance
|
||||
|
||||
|
||||
logger = SingletonLogger.get_logger()
|
||||
Reference in New Issue
Block a user