1
0
Fork 0
mirror of https://github.com/kakwa/ldapcherry synced 2025-07-03 20:07:42 +02:00

fix log_level + unit tests

* python logging doesn't support the 7 log levels of syslog, compensate it
* adding unit test on log level
This commit is contained in:
kakwa 2015-05-18 23:59:54 +02:00
parent 2ba56128ac
commit bfd1969ab3
2 changed files with 17 additions and 3 deletions

View file

@ -185,7 +185,7 @@ class LdapCherry(object):
if level == 'debug':
return logging.DEBUG
elif level == 'notice':
return logging.NOTICE
return logging.INFO
elif level == 'info':
return logging.INFO
elif level == 'warning' or level == 'warn':
@ -195,9 +195,9 @@ class LdapCherry(object):
elif level == 'critical' or level == 'crit':
return logging.CRITICAL
elif level == 'alert':
return logging.ALERT
return logging.CRITICAL
elif level == 'emergency' or level == 'emerg':
return logging.EMERGENCY
return logging.CRITICAL
else:
return logging.INFO