mirror of
https://github.com/vale981/doccam-pi
synced 2025-03-04 17:01:40 -05:00
zeah
This commit is contained in:
parent
3abe835452
commit
001dff8c9e
1 changed files with 4 additions and 4 deletions
8
main.js
8
main.js
|
@ -42,8 +42,8 @@ let logger = new(winston.Logger)({
|
|||
colorize: true,
|
||||
timestamp: true,
|
||||
json: true,
|
||||
maxsize: 1000000,
|
||||
maxFiles: 1
|
||||
maxsize: 500000,
|
||||
maxFiles: 10
|
||||
})
|
||||
]
|
||||
});
|
||||
|
@ -326,12 +326,12 @@ var commandHandlers = function commandHandlers(command, cb) {
|
|||
});
|
||||
},
|
||||
getLogs: function() {
|
||||
fs.readFile(__dirname + '/process.log', 'utf-8', function(err, data) {
|
||||
logger.query({limit: 100}}, function (err, data) {
|
||||
let lines;
|
||||
if (err) {
|
||||
lines = [];
|
||||
} else
|
||||
lines = data.trim().split('\n').slice(-100);
|
||||
lines = data;
|
||||
if (lines.length === 1)
|
||||
lines = [];
|
||||
socket.emit('data', {
|
||||
|
|
Loading…
Add table
Reference in a new issue