bugfix
This commit is contained in:
parent
827f27738f
commit
97e2137e33
@ -14,12 +14,15 @@ logfile = -1
|
|||||||
g_levelname='info'
|
g_levelname='info'
|
||||||
level = levels.get('info')
|
level = levels.get('info')
|
||||||
|
|
||||||
def create_logger(name, formater=defaultfmt, levelname=g_levelname, file=None):
|
def create_logger(name, formater=defaultfmt, levelname=None, file=None):
|
||||||
global logfile, level
|
global logfile, level
|
||||||
if logfile == -1:
|
if logfile == -1:
|
||||||
logfile = file
|
logfile = file
|
||||||
ret = logging.getLogger(name)
|
ret = logging.getLogger(name)
|
||||||
g_levelname = levelname
|
if levelname:
|
||||||
|
g_levelname = levelname
|
||||||
|
else:
|
||||||
|
levelname = g_levelname
|
||||||
level = levels.get(levelname, levels.get('info'))
|
level = levels.get(levelname, levels.get('info'))
|
||||||
ret.setLevel(level)
|
ret.setLevel(level)
|
||||||
format = logging.Formatter(formater)
|
format = logging.Formatter(formater)
|
||||||
|
Loading…
Reference in New Issue
Block a user