aboutsummaryrefslogtreecommitdiffstats
path: root/src/gr-fadingui/python/logger.py
blob: a101b9e4fca1410772a2cab7c8b05b5daae4eaee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import logging
import sys

formatter = logging.Formatter("[%(name)s] %(levelname)s: %(message)s")
stdout_handler = logging.StreamHandler(sys.stdout)

def get_logger(module):
    log = logging.getLogger(module)

    log.addHandler(stdout_handler)
    stdout_handler.setFormatter(formatter)

    log.setLevel(logging.WARNING)
    return log