a | b/utils/logger.py | ||
---|---|---|---|
1 | import sys |
||
2 | import pprint as pp |
||
3 | from loguru import logger |
||
4 | |||
5 | PPRINT = pp.PrettyPrinter(indent=4) |
||
6 | |||
7 | # Custom log format |
||
8 | fmt = "{message}" |
||
9 | config = { |
||
10 | "handlers": [ |
||
11 | {"sink": sys.stderr, "format": fmt}, |
||
12 | ], |
||
13 | } |
||
14 | logger.configure(**config) |
||
15 | |||
16 | def pprint(*arg): |
||
17 | ''' |
||
18 | Print large and indented objects clearly. |
||
19 | |||
20 | Args: |
||
21 | *arg: Variable number of arguments to print. |
||
22 | ''' |
||
23 | PPRINT.pprint(arg) |