FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 02-17-2010, 03:53 PM
Ales Kozumplik
 
Default logging: initialize tty3 logging in anaconda_log, along with all other basic loggers.

---
anaconda | 7 -------
anaconda_log.py | 8 ++++++++
2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/anaconda b/anaconda
index 96595fa..951ff3e 100755
--- a/anaconda
+++ b/anaconda
@@ -808,14 +808,7 @@ if __name__ == "__main__":
_ = lambda x: gettext.ldgettext("anaconda", x)

anaconda = Anaconda()
-
- if not iutil.isS390() and os.access("/dev/tty3", os.W_OK):
- anaconda_log.logger.addFileHandler("/dev/tty3", log,
- fmtStr=anaconda_log.TTY_FORMAT,
- autoLevel=True)
-
warnings.showwarning = AnacondaShowWarning
-
setupTranslations()

# reset python's default SIGINT handler
diff --git a/anaconda_log.py b/anaconda_log.py
index 6ce8955..74f97b7 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")
--
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-18-2010, 06:24 AM
Hans de Goede
 
Default logging: initialize tty3 logging in anaconda_log, along with all other basic loggers.

Ack.

On 02/17/2010 05:53 PM, Ales Kozumplik wrote:

---
anaconda | 7 -------
anaconda_log.py | 8 ++++++++
2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/anaconda b/anaconda
index 96595fa..951ff3e 100755
--- a/anaconda
+++ b/anaconda
@@ -808,14 +808,7 @@ if __name__ == "__main__":
_ = lambda x: gettext.ldgettext("anaconda", x)

anaconda = Anaconda()
-
- if not iutil.isS390() and os.access("/dev/tty3", os.W_OK):
- anaconda_log.logger.addFileHandler("/dev/tty3", log,
- fmtStr=anaconda_log.TTY_FORMAT,
- autoLevel=True)
-
warnings.showwarning = AnacondaShowWarning
-
setupTranslations()

# reset python's default SIGINT handler
diff --git a/anaconda_log.py b/anaconda_log.py
index 6ce8955..74f97b7 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")


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org