[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Pulp-list] Implicitly installing logging handlers is not good



Hi,

Working on the Pulp web UI prototype, I just had to monkeypatch pulp.client.logutil.getLogger to replace it with the standard logging.getLogger().

The implicit handler it adds simply didn't work correctly in the context of a Django web app being served via Apache.

Implicitly adding handlers like that in library code runs specifically counter to advice from upstream:
http://docs.python.org/howto/logging.html#configuring-logging-for-a-library

The configuration of logging handlers would more appropriately be part of the cli code (e.g. in pulp.client.cli.core) rather than the underlying library.

Cheers,
Nick.

--
Nick Coghlan
Red Hat Engineering Operations, Brisbane


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]