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:21 AM
Hans de Goede
 
Default logging: addFileHandler does not set autoLevel by default

Ack.

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

---
anaconda | 3 ++-
anaconda_log.py | 6 +++---
storage/storage_log.py | 3 ++-
3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/anaconda b/anaconda
index f4ab9e2..96595fa 100755
--- a/anaconda
+++ b/anaconda
@@ -811,7 +811,8 @@ if __name__ == "__main__":

if not iutil.isS390() and os.access("/dev/tty3", os.W_OK):
anaconda_log.logger.addFileHandler("/dev/tty3", log,
- fmtStr=anaconda_log.TTY_FORMAT)
+ fmtStr=anaconda_log.TTY_FORMAT,
+ autoLevel=True)

warnings.showwarning = AnacondaShowWarning

diff --git a/anaconda_log.py b/anaconda_log.py
index 3f7baa3..31a8f74 100644
--- a/anaconda_log.py
+++ b/anaconda_log.py
@@ -71,14 +71,14 @@ class AnacondaLog:
self.logger = logging.getLogger("anaconda")
self.logger.setLevel(logging.DEBUG)
self.addFileHandler(MAIN_LOG_FILE, self.logger,
- autoLevel=False, minLevel=logging.DEBUG)
+ minLevel=logging.DEBUG)
self.forwardToSyslog(self.logger)

# External program output log
program_logger = logging.getLogger("program")
program_logger.setLevel(logging.DEBUG)
self.addFileHandler(PROGRAM_LOG_FILE, program_logger,
- autoLevel=False, minLevel=logging.DEBUG)
+ minLevel=logging.DEBUG)
self.forwardToSyslog(program_logger)

# Create a second logger for just the stuff we want to dup on
@@ -95,7 +95,7 @@ class AnacondaLog:
# Add a simple handler - file or stream, depending on what we're given.
def addFileHandler (self, file, addToLogger, minLevel=DEFAULT_TTY_LEVEL,
fmtStr=ENTRY_FORMAT,
- autoLevel=True):
+ autoLevel=False):
if isinstance(file, types.StringTypes):
logfileHandler = logging.FileHandler(file)
else:
diff --git a/storage/storage_log.py b/storage/storage_log.py
index e5dbadc..a52513d 100644
--- a/storage/storage_log.py
+++ b/storage/storage_log.py
@@ -27,5 +27,6 @@ logger.setLevel(logging.DEBUG)
anaconda_log.logger.addFileHandler("/tmp/storage.log", logger, logging.DEBUG)
anaconda_log.logger.addFileHandler("/dev/tty3", logger,
anaconda_log.DEFAULT_TTY_LEVEL,
- anaconda_log.TTY_FORMAT)
+ anaconda_log.TTY_FORMAT,
+ autoLevel=True)
anaconda_log.logger.forwardToSyslog(logger)


_______________________________________________
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 11:51 AM.

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