1
0
Fork 0

Fix logs regex

This commit is contained in:
Chocobozzz 2019-12-12 09:15:38 +01:00
parent 7269868682
commit 3c0d0c669d
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -79,6 +79,7 @@ async function generateOutput (options: {
if (nameFilter.exec(meta.file) === null) continue if (nameFilter.exec(meta.file) === null) continue
const path = join(CONFIG.STORAGE.LOG_DIR, meta.file) const path = join(CONFIG.STORAGE.LOG_DIR, meta.file)
logger.debug('Opening %s to fetch logs.', path)
const result = await getOutputFromFile(path, startDate, endDate, level, currentSize) const result = await getOutputFromFile(path, startDate, endDate, level, currentSize)
if (!result.output) break if (!result.output) break
@ -136,5 +137,5 @@ async function getOutputFromFile (path: string, startDate: Date, endDate: Date,
} }
function generateLogNameFilter (baseName: string) { function generateLogNameFilter (baseName: string) {
return new RegExp('^' + baseName.replace(/\.log$/, '') + '\d*.log$') return new RegExp('^' + baseName.replace(/\.log$/, '') + '\\d*.log$')
} }