Add only one handler to logger
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
4f4fd845d9
commit
b9fd755a05
@ -146,9 +146,11 @@ class Gather(GatherBase):
|
|||||||
self.logger = logging.getLogger("gather_dnf")
|
self.logger = logging.getLogger("gather_dnf")
|
||||||
self.logger.setLevel(logging.DEBUG)
|
self.logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
|
if not self.logger.handlers:
|
||||||
# default logging handler
|
# default logging handler
|
||||||
handler = logging.StreamHandler()
|
handler = logging.StreamHandler()
|
||||||
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)-8s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S"))
|
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)-8s] %(message)s",
|
||||||
|
datefmt="%Y-%m-%d %H:%M:%S"))
|
||||||
handler.setLevel(logging.DEBUG)
|
handler.setLevel(logging.DEBUG)
|
||||||
self.logger.addHandler(handler)
|
self.logger.addHandler(handler)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user