diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-08-30 18:31:13 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-08-30 18:31:13 (GMT) |
commit | 609364a9898ef63e26be191cb092f0d37ab95340 (patch) | |
tree | b60e9fbb773799fa26cbd8c9fa39bfb46e52dc1d /Lib/logging | |
parent | 8b7da623ceb1e37d757cef95204c2384e1044a44 (diff) | |
download | cpython-609364a9898ef63e26be191cb092f0d37ab95340.zip cpython-609364a9898ef63e26be191cb092f0d37ab95340.tar.gz cpython-609364a9898ef63e26be191cb092f0d37ab95340.tar.bz2 |
Logging: removed some old commented out code.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 4 | ||||
-rw-r--r-- | Lib/logging/handlers.py | 11 |
2 files changed, 1 insertions, 14 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index afb4004..926b7be 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -935,16 +935,13 @@ class PlaceHolder(object): """ Initialize with the specified logger being a child of this placeholder. """ - #self.loggers = [alogger] self.loggerMap = { alogger : None } def append(self, alogger): """ Add the specified logger as a child of this placeholder. """ - #if alogger not in self.loggers: if alogger not in self.loggerMap: - #self.loggers.append(alogger) self.loggerMap[alogger] = None # @@ -1267,7 +1264,6 @@ class Logger(Filterer): Remove the specified handler from this logger. """ if hdlr in self.handlers: - #hdlr.close() hdlr.acquire() try: self.handlers.remove(hdlr) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 906df16..332aefc 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -125,7 +125,6 @@ class RotatingFileHandler(BaseRotatingHandler): sfn = "%s.%d" % (self.baseFilename, i) dfn = "%s.%d" % (self.baseFilename, i + 1) if os.path.exists(sfn): - #print "%s -> %s" % (sfn, dfn) if os.path.exists(dfn): os.remove(dfn) os.rename(sfn, dfn) @@ -133,7 +132,6 @@ class RotatingFileHandler(BaseRotatingHandler): if os.path.exists(dfn): os.remove(dfn) os.rename(self.baseFilename, dfn) - #print "%s -> %s" % (self.baseFilename, dfn) self.mode = 'w' self.stream = self._open() @@ -283,7 +281,6 @@ class TimedRotatingFileHandler(BaseRotatingHandler): t = int(time.time()) if t >= self.rolloverAt: return 1 - #print "No need to rollover: %d, %d" % (t, self.rolloverAt) return 0 def getFilesToDelete(self): @@ -330,14 +327,8 @@ class TimedRotatingFileHandler(BaseRotatingHandler): os.remove(dfn) os.rename(self.baseFilename, dfn) if self.backupCount > 0: - # find the oldest log file and delete it - #s = glob.glob(self.baseFilename + ".20*") - #if len(s) > self.backupCount: - # s.sort() - # os.remove(s[0]) for s in self.getFilesToDelete(): os.remove(s) - #print "%s -> %s" % (self.baseFilename, dfn) self.mode = 'w' self.stream = self._open() currentTime = int(time.time()) @@ -783,7 +774,7 @@ class SysLogHandler(logging.Handler): prio = '<%d>' % self.encodePriority(self.facility, self.mapPriority(record.levelname)) prio = prio.encode('utf-8') - #Message is a string. Convert to bytes as required by RFC 5424 + # Message is a string. Convert to bytes as required by RFC 5424 msg = msg.encode('utf-8') if codecs: msg = codecs.BOM_UTF8 + msg |