mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
Filter log files to rpt
This commit is contained in:
parent
ac985f98a9
commit
a33c866644
@ -25,7 +25,7 @@ Logs.generateLogFileName = function (suffix) {
|
||||
.replace(/:/g, '-') // Replace time dividers with dash
|
||||
.replace(/T/, '_') // Remove date and time divider
|
||||
.replace(/\..+/, '') // Remove milliseconds
|
||||
return 'arma3server_' + dateStr + '_' + suffix + '.log'
|
||||
return 'arma3server_' + dateStr + '_' + suffix + '.rpt'
|
||||
}
|
||||
|
||||
Logs.prototype.delete = function (filename, callback) {
|
||||
@ -86,7 +86,9 @@ Logs.prototype.logFiles = function (callback) {
|
||||
return
|
||||
}
|
||||
|
||||
files = files.map(function (file) {
|
||||
files = files.filter(function (file) {
|
||||
return file.endsWith('.rpt')
|
||||
}).map(function (file) {
|
||||
return {
|
||||
name: file,
|
||||
path: path.join(directory, file)
|
||||
|
@ -19,13 +19,13 @@ describe('Logs', function () {
|
||||
|
||||
describe('generateLogFileName()', function () {
|
||||
it('should generate valid file name', function () {
|
||||
Logs.generateLogFileName('test').should.eql('arma3server_2015-10-21_19-28-32_test.log')
|
||||
Logs.generateLogFileName('test').should.eql('arma3server_2015-10-21_19-28-32_test.rpt')
|
||||
})
|
||||
})
|
||||
|
||||
describe('generateLogFilePath()', function () {
|
||||
it('should generate valid file path', function () {
|
||||
logs.generateLogFilePath('test').should.eql(path.join('/tmp', 'logs', 'arma3server_2015-10-21_19-28-32_test.log'))
|
||||
logs.generateLogFilePath('test').should.eql(path.join('/tmp', 'logs', 'arma3server_2015-10-21_19-28-32_test.rpt'))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user