From: Chris Lamb Date: Thu, 29 Oct 2009 13:21:35 +0000 (+0000) Subject: Don't log "dak top-level starting" every time we run "dak ls" or something. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e0cdd341363ab61ec79f2c5af62007c2af77bcf;p=dak Don't log "dak top-level starting" every time we run "dak ls" or something. Signed-off-by: Chris Lamb --- diff --git a/dak/dak.py b/dak/dak.py index 448c137f..0d92c7d9 100755 --- a/dak/dak.py +++ b/dak/dak.py @@ -156,7 +156,7 @@ Available commands:""" def main(): """Launch dak functionality.""" - logger = Logger(Config(), 'dak top-level') + logger = Logger(Config(), 'dak top-level', print_starting=False) functionality = init() modules = [ command for (command, _) in functionality ] diff --git a/daklib/daklog.py b/daklib/daklog.py index dfcae368..fb33b0bd 100755 --- a/daklib/daklog.py +++ b/daklib/daklog.py @@ -38,7 +38,7 @@ class Logger: logfile = None program = None - def __init__ (self, Cnf, program, debug=0): + def __init__ (self, Cnf, program, debug=0, print_starting=True): "Initialize a new Logger object" self.Cnf = Cnf self.program = program @@ -58,7 +58,8 @@ class Logger: logfile = utils.open_file(logfilename, 'a') os.umask(umask) self.logfile = logfile - self.log(["program start"]) + if print_starting: + self.log(["program start"]) def log (self, details): "Log an event"