Lines Matching +full:days +full:- +full:before +full:- +full:close
1 # Copyright 2001-2021 by Vinay Sajip. All Rights Reserved.
21 Copyright (C) 2001-2021 Vinay Sajip. All Rights Reserved.
139 written to is always "app.log" - when it gets filled up, it is closed
165 self.stream.close()
168 for i in range(self.backupCount - 1, 0, -1):
190 # See bpo-45401: Never rollover anything other than regular files
197 self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
208 files are kept - the oldest ones are deleted.
223 # S - Seconds
224 # M - Minutes
225 # H - Hours
226 # D - Days
227 # midnight - roll over at midnight
228 # W{0-6} - roll over on a certain day; 0 - Monday
234 self.suffix = "%Y-%m-%d_%H-%M-%S"
235 self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}(\.\w+)?$"
238 self.suffix = "%Y-%m-%d_%H-%M"
239 self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}(\.\w+)?$"
242 self.suffix = "%Y-%m-%d_%H"
243 self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}(\.\w+)?$"
246 self.suffix = "%Y-%m-%d"
247 self.extMatch = r"^\d{4}-\d{2}-\d{2}(\.\w+)?$"
255 self.suffix = "%Y-%m-%d"
256 self.extMatch = r"^\d{4}-\d{2}-\d{2}(\.\w+)?$"
300 r = rotate_ts - ((currentHour * 60 + currentMinute) * 60 +
303 # Rotate time is before the current time (for example when
309 # If we are rolling over on a certain day, add in the number of days until
314 # day 2 (Wednesday) and rollover is on day 6 (Sunday). Days to
315 # next rollover is simply 6 - 2 - 1, or 3.
318 # Days to rollover is 6 - 5 + 3, or 4. In this case, it's the
319 # number of days left in the current week (1) plus the number
320 # of days in the next week until the rollover day (3).
328 daysToWait = self.dayOfWeek - day
330 daysToWait = 6 - day + self.dayOfWeek + 1
333 dstNow = t[-1]
334 dstAtRollover = time.localtime(newRolloverAt)[-1]
336 … if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour
337 addend = -3600
338 … else: # DST bows out before next rollover, so we need to add an hour
372 # See bpo-44753: Don't use the extension when computing the prefix.
391 # See bpo-45628: The date/time suffix could be anywhere in the
402 result = result[:len(result) - self.backupCount]
414 self.stream.close()
418 dstNow = time.localtime(currentTime)[-1]
419 t = self.rolloverAt - self.interval
424 dstThen = timeTuple[-1]
429 addend = -3600
446 dstAtRollover = time.localtime(newRolloverAt)[-1]
448 if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour
449 addend = -3600
450 else: # DST bows out before next rollover, so we need to add an hour
467 under Windows open files cannot be moved or renamed - logging
468 opens the files with exclusive locks - and so there is no need
482 self.dev, self.ino = -1, -1
495 has, close the old stream and reopen the file to get the
512 self.stream.close()
522 If underlying file has changed, reopen the file before emitting the
546 When the attribute *closeOnError* is set to True - if a socket error
580 result.close() # Issue 19182
601 self.retryTime = None # next time, no delay before trying
628 self.sock.close()
657 An error has occurred during logging. Most likely cause -
658 connection lost. Close the socket so that we can retry on the
662 self.sock.close()
673 If there was a problem with the socket, re-establishes the
682 def close(self): member in SocketHandler
691 sock.close()
692 logging.Handler.close(self)
731 when the network is busy - UDP does not guarantee delivery and
742 http://www.nightmare.com/squirl/python-ext/misc/syslog.py
749 # priorities/facilities are encoded into a single 32-bit quantity, where
750 # the bottom 3 bits are the priority (0-7) and the top 28 bits are the
751 # facility (0-big number). Both the priorities and the facilities map
752 # roughly one-to-one to strings in the syslogd(8) source code. This
764 LOG_DEBUG = 7 # debug-level messages
768 LOG_USER = 1 # random user-level messages
822 "solaris-cron": LOG_SOLCRON,
837 #there's more to it than meets the eye - in some locales, lowercasing
879 self.socket.close()
890 self.socket.close()
898 --- the method will be called again when emitting an event,
933 sock.close()
942 integers - if strings are passed, the facility_names and
952 def close(self): member in SysLogHandler
961 sock.close()
962 logging.Handler.close(self)
971 mapping by lowercasing the logging level name because of locale-
997 prio = prio.encode('utf-8')
999 msg = msg.encode('utf-8')
1009 self.socket.close()
1029 line of the email. To specify a non-standard SMTP port, use the
1035 will be either an empty tuple, or a single-value tuple with the name
1036 of a keyfile, or a 2-value tuple with the names of the keyfile and
1062 If you want to specify a subject line which is record-dependent,
1123 # existing source - handle this specific case.
1193 def close(self): member in NTEventLogHandler
1200 Viewer - it needs to be able to access the registry to get the
1204 logging.Handler.close(self)
1257 Send the record to the web server as a percent-encoded dictionary
1281 h.putheader("Content-type",
1282 "application/x-www-form-urlencoded")
1283 h.putheader("Content-length", str(len(data)))
1286 s = ('%s:%s' % self.credentials).encode('utf-8')
1291 h.send(data.encode('utf-8'))
1342 def close(self): member in BufferingHandler
1344 Close the handler.
1346 This version just flushes and chains to the parent class' close().
1351 logging.Handler.close(self)
1369 reasons - the old behaviour is that when the handler is closed, the
1413 def close(self): member in MemoryHandler
1425 BufferingHandler.close(self)
1434 (in a multi-process application), so as to avoid file write contention
1464 arguments, and removes unpickleable items from the record in-place.
1481 # bpo-35726: make copy of record to avoid affecting other handlers in the chain.
1545 This method just returns the passed-in record. You may want to
1547 manipulation of the record before passing it to the handlers.
1605 Note that if you don't call this before your application exits, there