Add timestamps to program.log and dnf.log
In lorax, lorax-composer, and livemedia-creator.
(cherry picked from commit fd173f7265
)
This commit is contained in:
parent
a038f7d904
commit
2fd6c6b549
@ -429,6 +429,8 @@ def setup_logging(logfile, theLogger):
|
|||||||
f = os.path.abspath(os.path.dirname(logfile))+"/program.log"
|
f = os.path.abspath(os.path.dirname(logfile))+"/program.log"
|
||||||
fh = logging.FileHandler(filename=f, mode="w")
|
fh = logging.FileHandler(filename=f, mode="w")
|
||||||
fh.setLevel(logging.DEBUG)
|
fh.setLevel(logging.DEBUG)
|
||||||
|
fmt = logging.Formatter("%(asctime)s %(levelname)s: %(message)s")
|
||||||
|
fh.setFormatter(fmt)
|
||||||
program_log.addHandler(fh)
|
program_log.addHandler(fh)
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,6 +84,8 @@ def setup_logging(opts):
|
|||||||
logfile = os.path.abspath(os.path.dirname(opts.logfile))+"/dnf.log"
|
logfile = os.path.abspath(os.path.dirname(opts.logfile))+"/dnf.log"
|
||||||
fh = logging.FileHandler(filename=logfile, mode="w")
|
fh = logging.FileHandler(filename=logfile, mode="w")
|
||||||
fh.setLevel(logging.NOTSET)
|
fh.setLevel(logging.NOTSET)
|
||||||
|
fmt = logging.Formatter("%(asctime)s %(levelname)s: %(message)s")
|
||||||
|
fh.setFormatter(fmt)
|
||||||
dnf_log.addHandler(fh)
|
dnf_log.addHandler(fh)
|
||||||
|
|
||||||
# Setup librepo logging
|
# Setup librepo logging
|
||||||
|
@ -69,6 +69,8 @@ def setup_logging(logfile):
|
|||||||
logfile = os.path.abspath(os.path.dirname(logfile))+"/program.log"
|
logfile = os.path.abspath(os.path.dirname(logfile))+"/program.log"
|
||||||
fh = logging.FileHandler(filename=logfile)
|
fh = logging.FileHandler(filename=logfile)
|
||||||
fh.setLevel(logging.DEBUG)
|
fh.setLevel(logging.DEBUG)
|
||||||
|
fmt = logging.Formatter("%(asctime)s %(levelname)s: %(message)s")
|
||||||
|
fh.setFormatter(fmt)
|
||||||
program_log.addHandler(fh)
|
program_log.addHandler(fh)
|
||||||
|
|
||||||
# Server request logging
|
# Server request logging
|
||||||
@ -83,6 +85,8 @@ def setup_logging(logfile):
|
|||||||
logfile = os.path.abspath(os.path.dirname(logfile))+"/dnf.log"
|
logfile = os.path.abspath(os.path.dirname(logfile))+"/dnf.log"
|
||||||
fh = logging.FileHandler(filename=logfile)
|
fh = logging.FileHandler(filename=logfile)
|
||||||
fh.setLevel(logging.DEBUG)
|
fh.setLevel(logging.DEBUG)
|
||||||
|
fmt = logging.Formatter("%(asctime)s %(levelname)s: %(message)s")
|
||||||
|
fh.setFormatter(fmt)
|
||||||
dnf_log.addHandler(fh)
|
dnf_log.addHandler(fh)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user