MCPcopy Create free account
hub / github.com/chibohe/text_recognition_toolbox / initial_logger

Function initial_logger

utils.py:47–64  ·  view source on GitHub ↗

ARGS log_file_path: string, path to the logging file

(log_file_path)

Source from the content-addressed store, hash-verified

45
46
47def initial_logger(log_file_path):
48 """
49 ARGS
50 log_file_path: string, path to the logging file
51 """
52 # logging settings
53 log_formatter = logging.Formatter("%(asctime)s [%(levelname)-5.5s] %(message)s")
54 root_logger = logging.getLogger()
55 root_logger.setLevel(logging.DEBUG)
56 # file handler
57 log_file_handler = logging.FileHandler(log_file_path)
58 log_file_handler.setFormatter(log_formatter)
59 root_logger.addHandler(log_file_handler)
60 # stream handler (stdout)
61 log_stream_handler = logging.StreamHandler(sys.stdout)
62 log_stream_handler.setFormatter(log_formatter)
63 root_logger.addHandler(log_stream_handler)
64 logging.info('Logging file is %s' % log_file_path)
65
66
67def create_module(module_str):

Callers 1

build_configFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected