mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Seperate dbs
This commit is contained in:
parent
728931d56e
commit
4e34267d44
9 changed files with 149 additions and 82 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue