[Freeipa-devel] [PATCH 53/53] ticket 2022 - modify codebase to utilize IPALogManager, obsoletes logging
Martin Kosek
mkosek at redhat.com
Wed Nov 16 12:35:53 UTC 2011
On Tue, 2011-11-15 at 14:41 -0500, John Dennis wrote:
>
> --
> John Dennis <jdennis at redhat.com>
>
> Looking to carve out IT costs?
> www.redhat.com/carveoutcosts/
Hi John,
thanks for your patch, that was a fair amount of work there :-) I tested
them both and have few comments:
1) Patch 53 will need rebasing
2) Logging for install tools (ipa-server-install, ...) is now broken.
DEBUG level messages should get to /var/log/ipaserver-install.log even
when the installer is run without --debug. My
ipaserver-install.log/ipaserver-uninstall.log was silent when i run just
`ipa-server-install' without --debug flag
3) Patch 53 touches most of our Python sources as it changes all
logging.* calls to log_mgr.root_logger.* calls. I think this may cause
problems (comment 1 is a good example). For example we may not be able
to cherry-pick most of new patches from master branch to ipa-2-1 branch
or other branches that do not use log_mgr.
Additionally, typing "log_mgr.root_logger.*" whenever I want to log
anything seems a bit awkward to me. These issues are avoidable, however.
Since all our Python code use just the root_logger, can we just simply
export root logger in log_manager.py namespace and that import it as
"logging" in other modules? Then we would save *a lot* of changes across
all our code. Something like this:
log_manager.py:
---------------
log_mgr = IPALogManager()
log_mgr.configure(dict(default_level='error',
handlers=[dict(name='console',
stream=sys.stderr)]),
configure_state='default')
+root_logger = log_mgr.root_logger
ipa-server-install:
-------------------
+from ipapython.log_manager import root_logger as logginng
...
# now, all logging will work as usual:
logging.error('Some files have not been restored, see /var/lib/ipa/sysrestore/sysrestore.index')
Martin
More information about the Freeipa-devel
mailing list