Commit f4478b9b authored by Cyril Roelandt's avatar Cyril Roelandt
Browse files

Add missing file.

parent 55d50672
......@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
Based on [Keep a Changelog](
## [Unreleased]
- upt.log: Add missing file
## [0.4] - 2018-03-20
### Added
- upt package: Add the '--output' option
# Copyright 2018 Cyril Roelandt
# Licensed under the 3-clause BSD license. See the LICENSE file.
import logging
import sys
class MaxLevelFilter(logging.Filter):
def __init__(self, max_level):
self.max_level = max_level
def filter(self, record):
return record.levelno < self.max_level
def create_logger(log_level):
logger = logging.getLogger('upt')
logger.setLevel(log_level or logging.INFO)
stdout_handler = logging.StreamHandler(sys.stdout)
stderr_handler = logging.StreamHandler(sys.stderr)
return logger
def logger_set_formatter(logger, name):
formatter = logging.Formatter(f'[%(levelname)-8s] [{name}] %(message)s')
for handler in logger.handlers:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment