add singleton logging

This commit is contained in:
Gokul Mohanarangan
2023-07-11 11:01:22 +05:30
parent 3128813ca3
commit 58c9cdf676
10 changed files with 24 additions and 19 deletions

14
utils/log_utils.py Normal file
View 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()