MCPcopy Create free account
hub / github.com/NineAbyss/ZeroG / get_logger

Function get_logger

code/main_TextBP_benchmark.py:45–71  ·  view source on GitHub ↗
(output_dir)

Source from the content-addressed store, hash-verified

43
44
45def get_logger(output_dir):
46 if output_dir != None:
47 os.makedirs(output_dir, exist_ok=True)
48 logging.basicConfig(
49 format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
50 datefmt="%m/%d/%Y %H:%M:%S",
51 level=logging.INFO,
52 handlers=[
53 logging.FileHandler(
54 "{}/log.txt".format(output_dir), mode="a", delay=False
55 ),
56 logging.StreamHandler(sys.stdout)
57 ]
58 )
59 else:
60 logging.basicConfig(
61 format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
62 datefmt="%m/%d/%Y %H:%M:%S",
63 level=logging.INFO,
64 handlers=[
65 logging.StreamHandler(sys.stdout),
66 ]
67 )
68
69 logger = logging.getLogger('CQABert')
70 logger.setLevel(10)
71 return logger
72
73
74def build_args():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected