|
|
@ -30,20 +30,6 @@ def get_logger(filename=None, log_level='debug'): |
|
|
|
return logger |
|
|
|
return logger |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def check_logger_options(config): |
|
|
|
|
|
|
|
""" Check passed config for logger options """ |
|
|
|
|
|
|
|
if 'log_level' in config: |
|
|
|
|
|
|
|
log_level = config['log_level'] |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
sys.stderr.write('"log_level" is missing in config\n') |
|
|
|
|
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
if 'log_file' in config: |
|
|
|
|
|
|
|
log_file = config['log_file'] |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
sys.stderr.write('"log_file is missing in config\n') |
|
|
|
|
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
return (log_file, log_level) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def validate_config(config): |
|
|
|
def validate_config(config): |
|
|
|
""" Validate configobj config """ |
|
|
|
""" Validate configobj config """ |
|
|
|
validator = validate.Validator() |
|
|
|
validator = validate.Validator() |
|
|
|