mirror of
https://github.com/vale981/doccam-pi
synced 2025-03-05 09:21: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,
|
colorize: true,
|
||||||
timestamp: true,
|
timestamp: true,
|
||||||
json: true,
|
json: true,
|
||||||
maxsize: 1000000,
|
maxsize: 500000,
|
||||||
maxFiles: 1
|
maxFiles: 10
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -326,12 +326,12 @@ var commandHandlers = function commandHandlers(command, cb) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getLogs: function() {
|
getLogs: function() {
|
||||||
fs.readFile(__dirname + '/process.log', 'utf-8', function(err, data) {
|
logger.query({limit: 100}}, function (err, data) {
|
||||||
let lines;
|
let lines;
|
||||||
if (err) {
|
if (err) {
|
||||||
lines = [];
|
lines = [];
|
||||||
} else
|
} else
|
||||||
lines = data.trim().split('\n').slice(-100);
|
lines = data;
|
||||||
if (lines.length === 1)
|
if (lines.length === 1)
|
||||||
lines = [];
|
lines = [];
|
||||||
socket.emit('data', {
|
socket.emit('data', {
|
||||||
|
|
Loading…
Add table
Reference in a new issue