Feature #3715
Enable or disable loggers
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
Associated revisions
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 about 10 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 11 years ago
- Status changed from Resolved to Closed