MCPcopy Index your code
hub / github.com/python/cpython / rotation_filename

Method rotation_filename

Lib/logging/handlers.py:85–102  ·  view source on GitHub ↗

Modify the filename of a log file when rotating. This is provided so that a custom filename can be provided. The default implementation calls the 'namer' attribute of the handler, if it's callable, passing the default name to it. If the attribute isn't call

(self, default_name)

Source from the content-addressed store, hash-verified

83 self.handleError(record)
84
85 def rotation_filename(self, default_name):
86 """
87 Modify the filename of a log file when rotating.
88
89 This is provided so that a custom filename can be provided.
90
91 The default implementation calls the 'namer' attribute of the
92 handler, if it's callable, passing the default name to
93 it. If the attribute isn't callable (the default is None), the name
94 is returned unchanged.
95
96 :param default_name: The default name for the log file.
97 """
98 if not callable(self.namer):
99 result = default_name
100 else:
101 result = self.namer(default_name)
102 return result
103
104 def rotate(self, source, dest):
105 """

Callers 2

doRolloverMethod · 0.80
doRolloverMethod · 0.80

Calls 1

namerMethod · 0.45

Tested by

no test coverage detected