rog lotate fixes

This commit is contained in:
mrfry 2021-03-30 10:03:04 +02:00
parent 385c29f68d
commit f5e157b147
2 changed files with 5 additions and 7 deletions

View file

@ -272,13 +272,7 @@ function rotateLog() {
'-' + '-' +
('0' + (date.getMonth() + 1)).slice(-2) + ('0' + (date.getMonth() + 1)).slice(-2) +
'-' + '-' +
('0' + date.getDate()).slice(-2) + ('0' + date.getDate()).slice(-2)
' ' +
('0' + date.getHours()).slice(-2) +
':' +
('0' + date.getMinutes()).slice(-2) +
':' +
('0' + date.getSeconds()).slice(-2)
if (utils.FileExists(logFile)) { if (utils.FileExists(logFile)) {
utils.CopyFile(logFile, logger.logDir + fname) utils.CopyFile(logFile, logger.logDir + fname)
@ -286,6 +280,9 @@ function rotateLog() {
if (utils.FileExists(vlogFile)) { if (utils.FileExists(vlogFile)) {
utils.CopyFile(vlogFile, logger.vlogDir + fname) utils.CopyFile(vlogFile, logger.vlogDir + fname)
} }
utils.WriteFile(fname, logger.logDir + fname)
utils.WriteFile(fname, logger.vlogDir + fname)
} }
function LogTimerAction() { function LogTimerAction() {

View file

@ -383,6 +383,7 @@ function log(text) {
} }
function writeInSameLine(text, returnToLineStart) { function writeInSameLine(text, returnToLineStart) {
// TODO: clear line before
process.stdout.write(text) process.stdout.write(text)
if (returnToLineStart) { if (returnToLineStart) {
process.stdout.write('\r') process.stdout.write('\r')