- do all logging using the same handler, to simplify reading the build log
- pass the file object to StreamHandler
This commit is contained in:
parent
dcf665862b
commit
cacaeb1285
1 changed files with 3 additions and 3 deletions
|
|
@ -653,13 +653,13 @@ def get_options():
|
|||
|
||||
def setup_logging(opts):
|
||||
global logfile, logfd
|
||||
logfd = file(logfile, 'w')
|
||||
logger = logging.getLogger('koji')
|
||||
logger = logging.getLogger('koji.vm')
|
||||
level = logging.INFO
|
||||
if opts.debug:
|
||||
level = logging.DEBUG
|
||||
logger.setLevel(level)
|
||||
handler = logging.StreamHandler(logfile)
|
||||
logfd = file(logfile, 'w')
|
||||
handler = logging.StreamHandler(logfd)
|
||||
handler.setLevel(level)
|
||||
handler.setFormatter(logging.Formatter('%(asctime)s [%(levelname)s] %(name)s: %(message)s'))
|
||||
logger.addHandler(handler)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue