Feature #3715

Enable or disable loggers

Added by Stavros Sachtouris almost 8 years ago. Updated almost 8 years ago.

Status:Closed Start date:05/10/2013
Priority:Medium Due date:
Assignee:Stavros Sachtouris % Done:

100%

Category:kamaki Spent time: -
Target version:v0.9

Description

Add an enable_logger and disable_logger method

E.g.

from kamaki import logger

logger.add_file_logger('my.logger', filename='/home/user/example.log')
...
LOGED CODE
...
logger.disable_logger('my.logger')
...
LOGS ARE NOT LOGED (!!!)
...
logger.enable_logger('my.logger')
...
LOG AGAIN
...

Related issues

related to ./kamaki - Feature #3668: Better organization for logging Closed 04/25/2013 05/10/2013
related to ./kamaki - Bug #3653: Stop add_file_logger default value from being /tmp/kamaki... Closed 04/23/2013
related to ./kamaki - Feature #3654: Instance-specific logfile Closed 04/23/2013

Associated revisions

Revision 9dc724e5
Added by Stavros Sachtouris almost 8 years ago

Allow activation/deactivation of specific loggers

refs: #3715
Logger settings are not aborted and will be restored at deactivation

Also, remove all logger creation functionality from kamaki.clients
A file or stream logger should be created an the kamaki.clients caller side
In this case, the caller is kamaki.cli
Kamaki.cli should handle where and how the loggers will output. Kamaki.clients
will log as name and the two extras: kamaki.clients.send/recv

An external app can now import kamaki and create a logger named "kamaki" and
this will log whatever kamaki is logging. The external app will handle loggers
as they wish.

History

#1 Updated by Stavros Sachtouris almost 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

activate/deactivate instead of enable/disable_logger

Also, moved all logger control and creation (except, of course, the logging itself) to kamaki.cli

As a rule: create and manage (format, location, etc) loggers at the caller app. The kamaki.lib should log without caring about
loggers format.

#2 Updated by Stavros Sachtouris almost 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF