Seperate dbs

This commit is contained in:
mrfry 2020-11-26 09:16:12 +01:00
parent 728931d56e
commit 4e34267d44
9 changed files with 149 additions and 82 deletions

View file

@ -22,7 +22,7 @@ const hr =
'---------------------------------------------------------------------------------'
export default {
GetDateString: GetDateString,
getColoredDateString: getColoredDateString,
Log: Log,
DebugLog: DebugLog,
GetColor: GetColor,
@ -70,7 +70,7 @@ function setNewLogfileName(): void {
logFileName = utils.GetDateString(true)
}
function GetDateString(): string {
function getColoredDateString(): string {
const date = new Date()
const dateString = utils.GetDateString()
return GetRandomColor(date.getHours().toString()) + dateString + C()
@ -99,7 +99,7 @@ function Log(msg: string | object, color?: string): void {
let log = msg
if (typeof msg !== 'object') {
const delimiter = DELIM + C(color)
log = C(color) + GetDateString() + delimiter + msg + C()
log = getColoredDateString() + delimiter + C(color) + msg + C()
}
console.log(log)
@ -109,7 +109,6 @@ function Log(msg: string | object, color?: string): void {
)
}
// FIXME: express.Request type, but with .cookies and .session
function LogReq(
req: any /*express.Request*/,
toFile?: boolean,
@ -162,7 +161,7 @@ function LogReq(
if (!toFile) {
Log(logEntry)
} else {
const defLogs = GetDateString() + dl + logEntry
const defLogs = getColoredDateString() + dl + logEntry
utils.AppendToFile(defLogs, vlogDir + logFileName)
}