MCPcopy Create free account
hub / github.com/Tencent/NeuralNLP-NeuralClassifier / __init__

Method __init__

util.py:52–67  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

50 return cls._instance
51
52 def __init__(self, config):
53 if config.log.log_level == "debug":
54 logging_level = logging.DEBUG
55 elif config.log.log_level == "info":
56 logging_level = logging.INFO
57 elif config.log.log_level == "warn":
58 logging_level = logging.WARN
59 elif config.log.log_level == "error":
60 logging_level = logging.ERROR
61 else:
62 raise TypeError(
63 "No logging type named %s, candidate is: info, debug, error")
64 logging.basicConfig(filename=config.log.logger_file,
65 level=logging_level,
66 format='%(asctime)s : %(levelname)s %(message)s',
67 filemode="a", datefmt='%Y-%m-%d %H:%M:%S')
68
69 @staticmethod
70 def debug(msg):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected