Lines Matching +full:days +full:- +full:before +full:- +full:close
1 # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
21 Copyright (C) 2001-2013 Vinay Sajip. All Rights Reserved.
103 written to is always "app.log" - when it gets filled up, it is closed
126 self.stream.close()
129 for i in range(self.backupCount - 1, 0, -1):
133 #print "%s -> %s" % (sfn, dfn)
157 self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
168 files are kept - the oldest ones are deleted.
178 # S - Seconds
179 # M - Minutes
180 # H - Hours
181 # D - Days
182 # midnight - roll over at midnight
183 # W{0-6} - roll over on a certain day; 0 - Monday
189 self.suffix = "%Y-%m-%d_%H-%M-%S"
190 self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}$"
193 self.suffix = "%Y-%m-%d_%H-%M"
194 self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$"
197 self.suffix = "%Y-%m-%d_%H"
198 self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}$"
201 self.suffix = "%Y-%m-%d"
202 self.extMatch = r"^\d{4}-\d{2}-\d{2}$"
210 self.suffix = "%Y-%m-%d"
211 self.extMatch = r"^\d{4}-\d{2}-\d{2}$"
245 r = _MIDNIGHT - ((currentHour * 60 + currentMinute) * 60 +
248 # If we are rolling over on a certain day, add in the number of days until
253 # day 2 (Wednesday) and rollover is on day 6 (Sunday). Days to
254 # next rollover is simply 6 - 2 - 1, or 3.
257 # Days to rollover is 6 - 5 + 3, or 4. In this case, it's the
258 # number of days left in the current week (1) plus the number
259 # of days in the next week until the rollover day (3).
267 daysToWait = self.dayOfWeek - day
269 daysToWait = 6 - day + self.dayOfWeek + 1
272 dstNow = t[-1]
273 dstAtRollover = time.localtime(newRolloverAt)[-1]
275 … if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour
276 addend = -3600
277 … else: # DST bows out before next rollover, so we need to add an hour
316 result = result[:len(result) - self.backupCount]
328 self.stream.close()
332 dstNow = time.localtime(currentTime)[-1]
333 t = self.rolloverAt - self.interval
338 dstThen = timeTuple[-1]
343 addend = -3600
361 dstAtRollover = time.localtime(newRolloverAt)[-1]
363 if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour
364 addend = -3600
365 else: # DST bows out before next rollover, so we need to add an hour
382 under Windows open files cannot be moved or renamed - logging
383 opens the files with exclusive locks - and so there is no need
392 self.dev, self.ino = -1, -1
405 has, close the old stream and reopen the file to get the
425 self.stream.close()
449 The attribute 'closeOnError' is set to 1 - which means that if
494 self.retryTime = None # next time, no delay before trying
527 left = left - sent
529 self.sock.close()
558 An error has occurred during logging. Most likely cause -
559 connection lost. Close the socket so that we can retry on the
563 self.sock.close()
574 If there was a problem with the socket, re-establishes the
585 def close(self): member in SocketHandler
594 sock.close()
597 logging.Handler.close(self)
630 when the network is busy - UDP does not guarantee delivery and
641 http://www.nightmare.com/squirl/python-ext/misc/syslog.py
648 # priorities/facilities are encoded into a single 32-bit quantity, where
649 # the bottom 3 bits are the priority (0-7) and the top 28 bits are the
650 # facility (0-big number). Both the priorities and the facilities map
651 # roughly one-to-one to strings in the syslogd(8) source code. This
663 LOG_DEBUG = 7 # debug-level messages
667 LOG_USER = 1 # random user-level messages
729 #there's more to it than meets the eye - in some locales, lowercasing
781 sock.close()
797 self.socket.close()
808 self.socket.close()
811 # curious: when talking to the unix-domain '/dev/log' socket, a
812 # zero-terminator seems to be required. this string is placed
820 integers - if strings are passed, the facility_names and
830 def close(self): member in SysLogHandler
837 self.socket.close()
840 logging.Handler.close(self)
847 mapping by lowercasing the logging level name because of locale-
869 msg = msg.encode('utf-8')
875 self.socket.close() # See issue 17981
897 line of the email. To specify a non-standard SMTP port, use the
903 will be either an empty tuple, or a single-value tuple with the name
904 of a keyfile, or a 2-value tuple with the names of the keyfile and
928 If you want to specify a subject line which is record-dependent,
1052 def close(self): member in NTEventLogHandler
1059 Viewer - it needs to be able to access the registry to get the
1063 logging.Handler.close(self)
1095 Send the record to the Web server as a percent-encoded dictionary
1117 h.putheader("Content-type",
1118 "application/x-www-form-urlencoded")
1119 h.putheader("Content-length", str(len(data)))
1173 def close(self): member in BufferingHandler
1175 Close the handler.
1177 This version just flushes and chains to the parent class' close().
1182 logging.Handler.close(self)
1230 def close(self): member in MemoryHandler
1240 BufferingHandler.close(self)