[6fe801]: / utils / logger.py

Download this file

23 lines (19 with data), 410 Bytes

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