mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Logrotate redo
This commit is contained in:
parent
54a978b152
commit
070defecb6
3 changed files with 48 additions and 23 deletions
|
@ -21,20 +21,6 @@
|
|||
const hr =
|
||||
'---------------------------------------------------------------------------------'
|
||||
|
||||
export default {
|
||||
getColoredDateString: getColoredDateString,
|
||||
Log: Log,
|
||||
DebugLog: DebugLog,
|
||||
GetColor: GetColor,
|
||||
LogReq: LogReq,
|
||||
LogStat: LogStat,
|
||||
Load: Load,
|
||||
logHashed: logHashed,
|
||||
hr: hr,
|
||||
C: C,
|
||||
setNewLogfileName: setNewLogfileName,
|
||||
}
|
||||
|
||||
const DELIM = C('green') + '|' + C()
|
||||
|
||||
// import express from 'express'
|
||||
|
@ -50,7 +36,7 @@ const uvStatsFile = 'stats/uvstats'
|
|||
const nologFile = './nolog'
|
||||
|
||||
const colors = ['green', 'red', 'yellow', 'blue', 'magenta', 'cyan']
|
||||
let logFileName = utils.GetDateString(true)
|
||||
const logFileName = 'log'
|
||||
|
||||
const writeInterval = 10
|
||||
const debugLevel = parseInt(process.env.NS_LOGLEVEL) || 0
|
||||
|
@ -68,10 +54,6 @@ let writes = 0
|
|||
|
||||
let noLogips = []
|
||||
|
||||
function setNewLogfileName(): void {
|
||||
logFileName = utils.GetDateString(true)
|
||||
}
|
||||
|
||||
function getColoredDateString(): string {
|
||||
const date = new Date()
|
||||
const dateString = utils.GetDateString()
|
||||
|
@ -418,3 +400,19 @@ function C(color?: string): string {
|
|||
}
|
||||
return '\x1b[0m'
|
||||
}
|
||||
|
||||
export default {
|
||||
getColoredDateString: getColoredDateString,
|
||||
Log: Log,
|
||||
DebugLog: DebugLog,
|
||||
GetColor: GetColor,
|
||||
LogReq: LogReq,
|
||||
LogStat: LogStat,
|
||||
Load: Load,
|
||||
logHashed: logHashed,
|
||||
hr: hr,
|
||||
C: C,
|
||||
logFileName: logFileName,
|
||||
logDir: logDir,
|
||||
vlogDir: vlogDir,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue