X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=daklib%2Flogging.py;h=125aa4af0b33b5c68b2b034c9aecc2be9b26a66a;hb=0d80b258098ff470433efa4d9c1f81b404883195;hp=11792c8baff4911965aad7907ba14676d7b64cc6;hpb=5ea129bba83114905c1266b77744eeed8e9bb020;p=dak.git diff --git a/daklib/logging.py b/daklib/logging.py old mode 100644 new mode 100755 index 11792c8b..125aa4af --- a/daklib/logging.py +++ b/daklib/logging.py @@ -1,8 +1,7 @@ #!/usr/bin/env python -# Logging functions +""" Logging functions """ # Copyright (C) 2001, 2002, 2006 James Troup -# $Id: logging.py,v 1.4 2005-11-15 09:50:32 ajt Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,13 +39,16 @@ class Logger: if not os.path.exists(logdir): umask = os.umask(00000) os.makedirs(logdir, 02775) + os.umask(umask) # Open the logfile logfilename = "%s/%s" % (logdir, time.strftime("%Y-%m")) - logfile = None - if debug: - logfile = sys.stderr - else: - logfile = utils.open_file(logfilename, 'a') + logfile = None + if debug: + logfile = sys.stderr + else: + umask = os.umask(00002) + logfile = utils.open_file(logfilename, 'a') + os.umask(umask) self.logfile = logfile # Log the start of the program user = pwd.getpwuid(os.getuid())[0]