candlepin/subscription-manager — pull request #645 by alikins (2013-06-10 19:08:19+00:00)
Title: Only create one log handler so we don't log twice.

Both yum plugins call init_log_for_yum, and calling
logutil._get_handler(), which was creating a new
log handler each time, and adding it as a handler
to the loggers. So if both yum plugins were loaded,
we had two file handlers for the logger, and were
getting each log entry twice.

Make "handler" a module global, and return it if
it already exists. Then logger.addHandler understands
not the same instance multiple times, as opposed to
adding a new instance as before.