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

Method rotate

Lib/logging/handlers.py:104–123  ·  view source on GitHub ↗

When rotating, rotate the current log. The default implementation calls the 'rotator' attribute of the handler, if it's callable, passing the source and dest arguments to it. If the attribute isn't callable (the default is None), the source is simply renamed

(self, source, dest)

Source from the content-addressed store, hash-verified

102 return result
103
104 def rotate(self, source, dest):
105 """
106 When rotating, rotate the current log.
107
108 The default implementation calls the 'rotator' attribute of the
109 handler, if it's callable, passing the source and dest arguments to
110 it. If the attribute isn't callable (the default is None), the source
111 is simply renamed to the destination.
112
113 :param source: The source filename. This is normally the base
114 filename, e.g. 'test.log'
115 :param dest: The destination filename. This is normally
116 what the source is rotated to, e.g. 'test.log.1'.
117 """
118 if not callable(self.rotator):
119 # Issue 18940: A file may not have been created if delay is True.
120 if os.path.exists(source):
121 os.rename(source, dest)
122 else:
123 self.rotator(source, dest)
124
125class RotatingFileHandler(BaseRotatingHandler):
126 """

Callers 10

doRolloverMethod · 0.45
doRolloverMethod · 0.45
xdFunction · 0.45
sFunction · 0.45
d3.min.jsFile · 0.45
test_countMethod · 0.45
test_indexMethod · 0.45
test_rotateMethod · 0.45
test_named_parametersMethod · 0.45

Calls 3

existsMethod · 0.45
renameMethod · 0.45
rotatorMethod · 0.45

Tested by 5

test_countMethod · 0.36
test_indexMethod · 0.36
test_rotateMethod · 0.36
test_named_parametersMethod · 0.36