admin/util/log.py
def doRollover(self):
        """
        do a rollover; in this case, a date/time stamp is appended to the filename
        when the rollover happens.  However, you want the file to be named for the
        start of the interval, not the current time.  If there is a backup count,
        then we have to get a list of matching filenames, sort them and remove
        the one with the oldest suffix.

        Override,   1. if dfn not exist then do rename
                    2. _open with "a" model
        """
        if self.stream:
            self.stream.close()
            self.stream = None
        # get the time that this sequence started at and make it a TimeTuple
        currentTime = int(time.time())
        dstNow = time.localtime(currentTime)[-1]
        t = self.rolloverAt - self.interval
        if self.utc:
            timeTuple = time.gmtime(t)
        else:
            timeTuple = time.localtime(t)
            dstThen = timeTuple[-1]
            if dstNow != dstThen:
                if dstNow:
                    addend = 3600
                else:
                    addend = -3600
                timeTuple = time.localtime(t + addend)
        dfn = self.rotation_filename(self.baseFilename + "." + time.strftime(self.suffix, timeTuple))

        if not os.path.exists(dfn) and os.path.exists(self.baseFilename):
            self.rotate(self.baseFilename, dfn)
        if self.backupCount > 0:
            for s in self.getFilesToDelete():
                # 防止多进程同时进入for循环，造成异常
                try:
                    os.remove(s)
                except FileNotFoundError:
                    pass
        if not self.delay:
            self.mode = "a"
            self.stream = self._open()
        newRolloverAt = self.computeRollover(currentTime)
        while newRolloverAt <= currentTime:
            newRolloverAt = newRolloverAt + self.interval
        # If DST changes and midnight or weekly rollover, adjust for this.
        if (self.when == 'MIDNIGHT' or self.when.startswith('W')) and not self.utc:
            dstAtRollover = time.localtime(newRolloverAt)[-1]
            if dstNow != dstAtRollover:
                if not dstNow:  # DST kicks in before next rollover, so we need to deduct an hour
                    addend = -3600
                else:  # DST bows out before next rollover, so we need to add an hour
                    addend = 3600
                newRolloverAt += addend
        self.rolloverAt = newRolloverAt

        do a rollover; in this case, a date/time stamp is appended to the filename
        when the rollover happens.  However, you want the file to be named for the
        start of the interval, not the current time.  If there is a backup count,
        then we have to get a list of matching filenames, sort them and remove
        the one with the oldest suffix.

        Override,   1. if dfn not exist then do rename
                    2. _open with "a" model
        
do a rollover; in this case, a date/time stamp is appended to the filename
when the rollover happens.  However, you want the file to be named for the
start of the interval, not the current time.  If there is a backup count,
then we have to get a list of matching filenames, sort them and remove
the one with the oldest suffix.

Override,   1. if dfn not exist then do rename
2. _open with "a" model
do a rollover ; in this case a date / time stamp is appended to the filename when the rollover happens . However you want the file to be named for the start of the interval not the current time . If there is a backup count then we have to get a list of matching filenames sort them and remove the one with the oldest suffix . Override 1 . if dfn not exist then do rename 2 . _open with " a " model
def doRollover(self):
        if self.stream:
            self.stream.close()
            self.stream = None
        currentTime = int(time.time())
        dstNow = time.localtime(currentTime)[-1]
        t = self.rolloverAt - self.interval
        if self.utc:
            timeTuple = time.gmtime(t)
        else:
            timeTuple = time.localtime(t)
            dstThen = timeTuple[-1]
            if dstNow != dstThen:
                if dstNow:
                    addend = 3600
                else:
                    addend = -3600
                timeTuple = time.localtime(t + addend)
        dfn = self.rotation_filename(self.baseFilename + "." + time.strftime(self.suffix, timeTuple))
        if not os.path.exists(dfn) and os.path.exists(self.baseFilename):
            self.rotate(self.baseFilename, dfn)
        if self.backupCount > 0:
            for s in self.getFilesToDelete():
                try:
                    os.remove(s)
                except FileNotFoundError:
                    pass
        if not self.delay:
            self.mode = "a"
            self.stream = self._open()
        newRolloverAt = self.computeRollover(currentTime)
        while newRolloverAt <= currentTime:
            newRolloverAt = newRolloverAt + self.interval
        if (self.when == 'MIDNIGHT' or self.when.startswith('W')) and not self.utc:
            dstAtRollover = time.localtime(newRolloverAt)[-1]
            if dstNow != dstAtRollover:
                if not dstNow:  
                    addend = -3600
                else:  
                    addend = 3600
                newRolloverAt += addend
        self.rolloverAt = newRolloverAt
def doRollover ( self ) : if self . stream : self . stream . close ( ) self . stream = None currentTime = int ( time . time ( ) ) dstNow = time . localtime ( currentTime ) [ - 1 ] t = self . rolloverAt - self . interval if self . utc : timeTuple = time . gmtime ( t ) else : timeTuple = time . localtime ( t ) dstThen = timeTuple [ - 1 ] if dstNow != dstThen : if dstNow : addend = 3600 else : addend = - 3600 timeTuple = time . localtime ( t + addend ) dfn = self . rotation_filename ( self . baseFilename + "." + time . strftime ( self . suffix , timeTuple ) ) if not os . path . exists ( dfn ) and os . path . exists ( self . baseFilename ) : self . rotate ( self . baseFilename , dfn ) if self . backupCount > 0 : for s in self . getFilesToDelete ( ) : try : os . remove ( s ) except FileNotFoundError : pass if not self . delay : self . mode = "a" self . stream = self . _open ( ) newRolloverAt = self . computeRollover ( currentTime ) while newRolloverAt <= currentTime : newRolloverAt = newRolloverAt + self . interval if ( self . when == 'MIDNIGHT' or self . when . startswith ( 'W' ) ) and not self . utc : dstAtRollover = time . localtime ( newRolloverAt ) [ - 1 ] if dstNow != dstAtRollover : if not dstNow : addend = - 3600 else : addend = 3600 newRolloverAt += addend self . rolloverAt = newRolloverAt
do a rollover; in this case, a date/time stamp is appended to the filename
when the rollover happens.
do a rollover ; in this case a date / time stamp is appended to the filename when the rollover happens .
"""
        do a rollover; in this case, a date/time stamp is appended to the filename
        when the rollover happens.  However, you want the file to be named for the
        start of the interval, not the current time.  If there is a backup count,
        then we have to get a list of matching filenames, sort them and remove
        the one with the oldest suffix.

        Override,   1. if dfn not exist then do rename
                    2. _open with "a" model
        """ # get the time that this sequence started at and make it a TimeTuple # 防止多进程同时进入for循环，造成异常 # If DST changes and midnight or weekly rollover, adjust for this. # DST kicks in before next rollover, so we need to deduct an hour # DST bows out before next rollover, so we need to add an hour
self