diff options
author | Ales Kozumplik <akozumpl@redhat.com> | 2010-02-17 14:49:59 +0100 |
---|---|---|
committer | Ales Kozumplik <akozumpl@redhat.com> | 2010-02-18 10:08:43 +0100 |
commit | d82723a8912501958658591ea1f1d229202f3b22 (patch) | |
tree | b29722ddd157bbea6383a45702879758705f5bf6 /anaconda_log.py | |
parent | 88e383bff31d52f99b242226ebda0b682fc5b950 (diff) | |
download | anaconda-d82723a8912501958658591ea1f1d229202f3b22.tar.gz anaconda-d82723a8912501958658591ea1f1d229202f3b22.tar.xz anaconda-d82723a8912501958658591ea1f1d229202f3b22.zip |
logging: initialize tty3 logging in anaconda_log, along with all other basic loggers.
Diffstat (limited to 'anaconda_log.py')
-rw-r--r-- | anaconda_log.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/anaconda_log.py b/anaconda_log.py index 1ee40cb85..b6f26f4f3 100644 --- a/anaconda_log.py +++ b/anaconda_log.py @@ -29,6 +29,8 @@ import logging from logging.handlers import SysLogHandler, SYSLOG_UDP_PORT import types +import iutil + DEFAULT_TTY_LEVEL = logging.INFO ENTRY_FORMAT = "%(asctime)s,%(msecs)03d %(levelname)s %(name)s: %(message)s" TTY_FORMAT = "%(levelname)s %(name)s: %(message)s" @@ -36,6 +38,7 @@ STDOUT_FORMAT = "%(asctime)s %(message)s" DATE_FORMAT = "%H:%M:%S" MAIN_LOG_FILE = "/tmp/anaconda.log" +MAIN_LOG_TTY = "/dev/tty3" PROGRAM_LOG_FILE = "/tmp/program.log" ANACONDA_SYSLOG_FACILITY = SysLogHandler.LOG_LOCAL1 @@ -76,6 +79,11 @@ class AnacondaLog: self.addFileHandler(MAIN_LOG_FILE, logger, minLevel=logging.DEBUG) self.forwardToSyslog(logger) + # Log to tty3. + if not iutil.isS390() and os.access(MAIN_LOG_TTY, os.W_OK): + self.addFileHandler(MAIN_LOG_TTY, logger, + fmtStr=TTY_FORMAT, + autoLevel=True) # External program output log program_logger = logging.getLogger("program") |