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 Java

 
 
LinkBack Thread Tools
 
Old 02-18-2010, 06:22 AM
Hans de Goede
 
Default logging: Loggers live a cosmopolitan life, forget about them after created.

Ack.

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

---
anaconda_log.py | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/anaconda_log.py b/anaconda_log.py
index 83a70c7..edaf232 100644
--- a/anaconda_log.py
+++ b/anaconda_log.py
@@ -32,6 +32,7 @@ import types
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"
+STDOUT_FORMAT = "%(asctime)s %(message)s"
DATE_FORMAT = "%H:%M:%S"

MAIN_LOG_FILE = "/tmp/anaconda.log"
@@ -70,11 +71,11 @@ class AnacondaLog:
self.tty_loglevel = DEFAULT_TTY_LEVEL
self.remote_syslog = None
# Create the base of the logger hierarcy.
- self.logger = logging.getLogger("anaconda")
- self.logger.setLevel(logging.DEBUG)
- self.addFileHandler(MAIN_LOG_FILE, self.logger,
+ logger = logging.getLogger("anaconda")
+ logger.setLevel(logging.DEBUG)
+ self.addFileHandler(MAIN_LOG_FILE, logger,
minLevel=logging.DEBUG)
- self.forwardToSyslog(self.logger)
+ self.forwardToSyslog(logger)

# External program output log
program_logger = logging.getLogger("program")
@@ -87,12 +88,11 @@ class AnacondaLog:
# stdout. Anything written here will also get passed up to the
# parent loggers for processing and possibly be written to the
# log.
- self.stdoutLogger = logging.getLogger("anaconda.stdout")
- self.stdoutLogger.setLevel(logging.INFO)
-
+ stdoutLogger = logging.getLogger("anaconda.stdout")
+ stdoutLogger.setLevel(logging.INFO)
# Add a handler for the duped stuff. No fancy formatting, thanks.
- self.addFileHandler (sys.stdout, self.stdoutLogger,
- fmtStr="%(asctime)s %(message)s", minLevel=logging.INFO)
+ self.addFileHandler(sys.stdout, stdoutLogger,
+ fmtStr=STDOUT_FORMAT, minLevel=logging.INFO)

# Add a simple handler - file or stream, depending on what we're given.
def addFileHandler (self, file, addToLogger, minLevel=DEFAULT_TTY_LEVEL,


_______________________________________________
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 06:25 AM.

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