upd (fw):

- temp removed internal event
- logger now also displays ms
This commit is contained in:
Danya H 2025-01-31 16:26:21 +00:00
parent 78d1831bbc
commit d5dc6924aa
3 changed files with 4 additions and 9 deletions

View File

@ -11,8 +11,3 @@ export const fw = {
/** ``rage-fw-rpc`` instance used under the hood. It is highly recommended to use this one if you need it instead of creating a new instance */ /** ``rage-fw-rpc`` instance used under the hood. It is highly recommended to use this one if you need it instead of creating a new instance */
rpc, rpc,
} }
;(async () => {
await fw.event.triggerClient(
'cefReady' as Parameters<typeof fw.event.triggerClient>[0],
)
})()

View File

@ -10,7 +10,7 @@ export class FW_Logger {
*/ */
public info(...message: unknown[]) { public info(...message: unknown[]) {
mp.console.logInfo( mp.console.logInfo(
`[${new Date().toLocaleTimeString()}] [INFO] ${message.join(' ')}`, `[${new Date().toLocaleTimeString(undefined, { hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalSecondDigits: 2 })}] [INFO] ${message.join(' ')}`,
) )
} }
@ -22,7 +22,7 @@ export class FW_Logger {
*/ */
public warn(...message: unknown[]) { public warn(...message: unknown[]) {
mp.console.logWarning( mp.console.logWarning(
`[${new Date().toLocaleTimeString()}] [WARN] ${message.join(' ')}`, `[${new Date().toLocaleTimeString(undefined, { hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalSecondDigits: 2 })}] [WARN] ${message.join(' ')}`,
) )
} }
@ -34,7 +34,7 @@ export class FW_Logger {
*/ */
public error(...message: unknown[]) { public error(...message: unknown[]) {
mp.console.logError( mp.console.logError(
`[${new Date().toLocaleTimeString()}] [ERROR] ${message.join(' ')}`, `[${new Date().toLocaleTimeString(undefined, { hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalSecondDigits: 2 })}] [ERROR] ${message.join(' ')}`,
) )
} }
} }

View File

@ -5,7 +5,7 @@ const { timestamp, printf, colorize } = format
/** Used to log in a server console */ /** Used to log in a server console */
export class FW_Logger { export class FW_Logger {
private format = printf(({ message, level }) => { private format = printf(({ message, level }) => {
return `[${new Date().toLocaleTimeString()}] [${level}]: ${message}` return `[${new Date().toLocaleTimeString(undefined, { hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalSecondDigits: 2 })}] [${level}]: ${message}`
}) })
private systemLogger = winston.createLogger({ private systemLogger = winston.createLogger({