From b1331a519b76cdefe34d748a6a978f7924f91e0d Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 9 Jan 2021 14:56:23 -0700 Subject: [PATCH] Add config option for datetime visibility in the logger --- server/src/main.ts | 1 + server/src/types/config.d.ts | 1 + server/template.toml | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/main.ts b/server/src/main.ts index 22eb409..cb5cdc2 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -25,6 +25,7 @@ export var hibernatedGames: string[] = []; export var games: {[index: string]: Game} = {}; export const log: Logger = new Logger({ + displayDateTime: conf.log.datetime, displayFunctionName: false, displayLoggerName: true, displayFilePath: `hidden`, diff --git a/server/src/types/config.d.ts b/server/src/types/config.d.ts index f114c07..dfda422 100644 --- a/server/src/types/config.d.ts +++ b/server/src/types/config.d.ts @@ -1,6 +1,7 @@ interface config { log: { level: `silly` | `debug` | `info` | `error` | `warn` | `fatal` | `trace`; + datetime: boolean; }; websocket: { port: number; diff --git a/server/template.toml b/server/template.toml index 9d1e438..81a57ec 100644 --- a/server/template.toml +++ b/server/template.toml @@ -87,4 +87,7 @@ directory = "" # - "error" # - "trace" # any other value will prevent the server from starting at runtime. -level = "info" \ No newline at end of file +level = "info" + +# Whether or not the log should output the date and time information in the log +datetime = true \ No newline at end of file