Changeset 8516
- Timestamp:
- 25 May 2012, 02:02:44 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/datacenter.py
r8513 r8516 35 35 36 36 #: Regular expression describing a logfile name with backup extension 37 RE_LOGFILE_ NAME = re.compile('^.+\.\d+$')37 RE_LOGFILE_BACKUP_NAME = re.compile('^.+\.\d+$') 38 38 39 39 class DataCenter(grok.Container, Logger): … … 85 85 return result 86 86 87 def getLogFiles(self ):87 def getLogFiles(self, exclude_backups=True): 88 88 """Get the files from logs/ subdir. Files are sorted by name. 89 90 By default backup logs ('app.log.1', etc.) are excluded. 89 91 """ 90 92 result = [] … … 94 96 for name in sorted(os.listdir(logdir)): 95 97 if not os.path.isfile(os.path.join(logdir, name)): 98 continue 99 if exclude_backups == True and RE_LOGFILE_BACKUP_NAME.match(name): 96 100 continue 97 101 result.append( … … 203 207 files = [basename,] 204 208 for name in os.listdir(os.path.join(self.storage, 'logs')): 205 if RE_LOGFILE_ NAME.match(name):209 if RE_LOGFILE_BACKUP_NAME.match(name): 206 210 files.append(name) 207 211 return sorted(files, key=numerical_suffix)
Note: See TracChangeset for help on using the changeset viewer.