client logger
This commit is contained in:
parent
97b094c3d4
commit
39ab22f9aa
@ -1,5 +1,7 @@
|
||||
import rpc from 'rage-rpc'
|
||||
|
||||
import Logger from './logger'
|
||||
|
||||
import type {
|
||||
RageFW_ClientEventCallback,
|
||||
RageFW_ClientEvent,
|
||||
@ -31,4 +33,7 @@ class Player {
|
||||
export const fw = {
|
||||
event: new Client(),
|
||||
player: new Player(),
|
||||
system: {
|
||||
log: new Logger(),
|
||||
},
|
||||
}
|
||||
|
19
client/src/logger.ts
Normal file
19
client/src/logger.ts
Normal file
@ -0,0 +1,19 @@
|
||||
export default class Logger {
|
||||
public error(message: unknown) {
|
||||
mp.console.logError(
|
||||
`[${new Date().toLocaleTimeString()}] [ERROR] ${message}`,
|
||||
)
|
||||
}
|
||||
|
||||
public warn(message: unknown) {
|
||||
mp.console.logWarning(
|
||||
`[${new Date().toLocaleTimeString()}] [WARN] ${message}`,
|
||||
)
|
||||
}
|
||||
|
||||
public info(message: unknown) {
|
||||
mp.console.logInfo(
|
||||
`[${new Date().toLocaleTimeString()}] [INFO] ${message}`,
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user