Logging: Allow rpc to set individual log levels.
bzr revid: p_christ@hol.gr-20100622093547-jax4vg7vp0o6zfz2
This commit is contained in:
parent
3c3833e824
commit
285e307f25
|
@ -268,8 +268,11 @@ class Logger(object):
|
|||
# better ignore the exception and carry on..
|
||||
pass
|
||||
|
||||
def set_loglevel(self, level):
|
||||
log = logging.getLogger()
|
||||
def set_loglevel(self, level, *args):
|
||||
if args and args[0]:
|
||||
log = logging.getLogger(str(args[0]))
|
||||
else:
|
||||
log = logging.getLogger()
|
||||
log.setLevel(logging.INFO) # make sure next msg is printed
|
||||
log.info("Log level changed to %s" % logging.getLevelName(level))
|
||||
log.setLevel(level)
|
||||
|
|
|
@ -556,9 +556,9 @@ GNU Public Licence.
|
|||
def exp_login_message(self):
|
||||
return tools.config.get('login_message', False)
|
||||
|
||||
def exp_set_loglevel(self,loglevel):
|
||||
def exp_set_loglevel(self, loglevel, *args):
|
||||
l = netsvc.Logger()
|
||||
l.set_loglevel(int(loglevel))
|
||||
l.set_loglevel(int(loglevel), *args)
|
||||
return True
|
||||
|
||||
def exp_get_stats(self):
|
||||
|
|
Loading…
Reference in New Issue