mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-02-05 10:26:48 +00:00
add singleton logging
This commit is contained in:
@@ -2,7 +2,7 @@ import configparser
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
from loguru import logger
|
||||
from log_utils import logger
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
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()
|
||||
@@ -2,7 +2,7 @@ import configparser
|
||||
|
||||
import nltk
|
||||
import torch
|
||||
from loguru import logger
|
||||
from log_utils import logger
|
||||
from nltk.corpus import stopwords
|
||||
from nltk.tokenize import word_tokenize
|
||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
|
||||
Reference in New Issue
Block a user