baseimage-tutorial-framework/tfw/main/logging.py

13 lines
314 B
Python
Raw Normal View History

2019-08-15 15:03:15 +00:00
from sys import stderr
from os.path import join
from tfw.config import TFWENV
from tfw.logging import Log, Logger, LogFormatter, VerboseLogFormatter
def setup_logger(name):
Logger([
Log(stderr, LogFormatter(20)),
Log(join(TFWENV.LOGS_DIR, name+'.log'), VerboseLogFormatter())
]).start()