2019-11-15 15:47:40 +00:00
|
|
|
import logging
|
2019-11-25 20:21:00 +00:00
|
|
|
import os
|
2019-11-15 15:47:40 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
logger = logging.getLogger('restic_volume_backup')
|
2019-11-25 20:21:00 +00:00
|
|
|
HOSTNAME = os.environ['HOSTNAME']
|
2019-11-15 15:47:40 +00:00
|
|
|
|
|
|
|
level = logging.INFO
|
|
|
|
logger.setLevel(level)
|
|
|
|
ch = logging.StreamHandler(stream=sys.stdout)
|
|
|
|
ch.setLevel(level)
|
2019-11-25 20:21:00 +00:00
|
|
|
ch.setFormatter(logging.Formatter(f'%(asctime)s - {HOSTNAME} - %(name)s - %(levelname)s - %(message)s'))
|
2019-11-15 15:47:40 +00:00
|
|
|
logger.addHandler(ch)
|