support log level override
This commit is contained in:
parent
dfa4caec54
commit
8481efd03c
@ -1806,17 +1806,16 @@ class SigRepoSync:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# This is temporary for now.
|
# This is temporary for now.
|
||||||
if logger is None:
|
self.log = logging.getLogger("sigreposync")
|
||||||
self.log = logging.getLogger("sigreposync")
|
self.log.setLevel(getattr(logging, logger.upper(), 'INFO'))
|
||||||
self.log.setLevel(logging.INFO)
|
handler = logging.StreamHandler(sys.stdout)
|
||||||
handler = logging.StreamHandler(sys.stdout)
|
handler.setLevel(logging.INFO)
|
||||||
handler.setLevel(logging.INFO)
|
formatter = logging.Formatter(
|
||||||
formatter = logging.Formatter(
|
'%(asctime)s :: %(name)s :: %(message)s',
|
||||||
'%(asctime)s :: %(name)s :: %(message)s',
|
'%Y-%m-%d %H:%M:%S'
|
||||||
'%Y-%m-%d %H:%M:%S'
|
)
|
||||||
)
|
handler.setFormatter(formatter)
|
||||||
handler.setFormatter(formatter)
|
self.log.addHandler(handler)
|
||||||
self.log.addHandler(handler)
|
|
||||||
|
|
||||||
self.log.info('sig reposync init')
|
self.log.info('sig reposync init')
|
||||||
self.log.info(self.profile + ' ' + self.major_version)
|
self.log.info(self.profile + ' ' + self.major_version)
|
||||||
|
Loading…
Reference in New Issue
Block a user