mylog.py 521 Bytes
Newer Older
MischaD's avatar
Utils  
MischaD committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import logging

logger = logging.getLogger("LBMweights")
logger.setLevel(logging.WARNING)

# fh = logging.FileHandler('mylbm.log')
# fh.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

# logger.addHandler(fh)
logger.addHandler(ch)

formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
ch.setFormatter(formatter)
# fh.setFormatter(formatter)

logger = logging.getLogger("LBMweights")
log_levels = dict(debug=logging.DEBUG, info=logging.INFO, warning=logging.WARNING)