Fixed log rotate
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Sun, 31 Jan 2021 07:03:45 +0000 (23:03 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sun, 31 Jan 2021 07:03:45 +0000 (23:03 -0800)
src/py/bbctrl/Log.py

index ee227d886689e2aca8b6a162fd58e04842e7a4e8..5870f3dfb84440d9be46ab70350225a24eb66e47 100644 (file)
@@ -180,6 +180,6 @@ class Log(object):
 
         if os.path.exists(fullpath):
             if n == 16: os.unlink(fullpath)
-            else: self._rotate(path, nextN)
-
-            os.rename(fullpath, '%s.%d' % (path, nextN))
+            else:
+                self._rotate(path, nextN)
+                os.rename(fullpath, '%s.%d' % (path, nextN))