• Home
  • Raw
  • Download

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
351 # See bpo-45401: Never rollover anything other than regular files
368 # See bpo-44753: Don't use the extension when computing the prefix.
387 # See bpo-45628: The date/time suffix could be anywhere in the
398 result = result[:len(result) - self.backupCount]
410 self.stream.close()
414 dstNow = time.localtime(currentTime)[-1]
415 t = self.rolloverAt - self.interval
420 dstThen = timeTuple[-1]
425 addend = -3600
442 dstAtRollover = time.localtime(newRolloverAt)[-1]
444 if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour
445 addend = -3600
446 else: # DST bows out before next rollover, so we need to add an hour
463 under Windows open files cannot be moved or renamed - logging
464 opens the files with exclusive locks - and so there is no need
478 self.dev, self.ino = -1, -1
491 has, close the old stream and reopen the file to get the
508 self.stream.close()
518 If underlying file has changed, reopen the file before emitting the
542 When the attribute *closeOnError* is set to True - if a socket error
576 result.close() # Issue 19182
597 self.retryTime = None # next time, no delay before trying
624 self.sock.close()
653 An error has occurred during logging. Most likely cause -
654 connection lost. Close the socket so that we can retry on the
658 self.sock.close()
669 If there was a problem with the socket, re-establishes the
678 def close(self): member in SocketHandler
687 sock.close()
688 logging.Handler.close(self)
727 when the network is busy - UDP does not guarantee delivery and
738 http://www.nightmare.com/squirl/python-ext/misc/syslog.py
745 # priorities/facilities are encoded into a single 32-bit quantity, where
746 # the bottom 3 bits are the priority (0-7) and the top 28 bits are the
747 # facility (0-big number). Both the priorities and the facilities map
748 # roughly one-to-one to strings in the syslogd(8) source code. This
760 LOG_DEBUG = 7 # debug-level messages
764 LOG_USER = 1 # random user-level messages
818 "solaris-cron": LOG_SOLCRON,
833 #there's more to it than meets the eye - in some locales, lowercasing
892 sock.close()
908 self.socket.close()
919 self.socket.close()
925 integers - if strings are passed, the facility_names and
935 def close(self): member in SysLogHandler
941 self.socket.close()
942 logging.Handler.close(self)
951 mapping by lowercasing the logging level name because of locale-
977 prio = prio.encode('utf-8')
979 msg = msg.encode('utf-8')
985 self.socket.close()
1005 line of the email. To specify a non-standard SMTP port, use the
1011 will be either an empty tuple, or a single-value tuple with the name
1012 of a keyfile, or a 2-value tuple with the names of the keyfile and
1038 If you want to specify a subject line which is record-dependent,
1160 def close(self): member in NTEventLogHandler
1167 Viewer - it needs to be able to access the registry to get the
1171 logging.Handler.close(self)
1224 Send the record to the web server as a percent-encoded dictionary
1248 h.putheader("Content-type",
1249 "application/x-www-form-urlencoded")
1250 h.putheader("Content-length", str(len(data)))
1253 s = ('%s:%s' % self.credentials).encode('utf-8')
1258 h.send(data.encode('utf-8'))
1309 def close(self): member in BufferingHandler
1311 Close the handler.
1313 This version just flushes and chains to the parent class' close().
1318 logging.Handler.close(self)
1336 reasons - the old behaviour is that when the handler is closed, the
1380 def close(self): member in MemoryHandler
1392 BufferingHandler.close(self)
1401 (in a multi-process application), so as to avoid file write contention
1432 in-place.
1445 # bpo-35726: make copy of record to avoid affecting other handlers in the chain.
1508 This method just returns the passed-in record. You may want to
1510 manipulation of the record before passing it to the handlers.
1568 Note that if you don't call this before your application exits, there