From 4f9ba9c7d69c33d1273ad7a6cd6415c3d0b5c903 Mon Sep 17 00:00:00 2001 From: Zed Date: Tue, 25 Feb 2025 04:28:45 +0000 Subject: [PATCH] Always print sessions logs --- src/auth.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/auth.nim b/src/auth.nim index bf3c957..0ff40f8 100644 --- a/src/auth.nim +++ b/src/auth.nim @@ -27,7 +27,7 @@ var enableLogging = false template log(str: varargs[string, `$`]) = - if enableLogging: echo "[sessions] ", str.join("") + echo "[sessions] ", str.join("") proc snowflakeToEpoch(flake: int64): int64 = int64(((flake shr 22) + 1288834974657) div 1000) @@ -188,15 +188,15 @@ proc initSessionPool*(cfg: Config; path: string) = enableLogging = cfg.enableDebug if path.endsWith(".json"): - echo "[sessions] ERROR: .json is not supported, the file must be a valid JSONL file ending in .jsonl" + log "ERROR: .json is not supported, the file must be a valid JSONL file ending in .jsonl" quit 1 if not fileExists(path): - echo "[sessions] ERROR: ", path, " not found. This file is required to authenticate API requests." + log "ERROR: ", path, " not found. This file is required to authenticate API requests." quit 1 - log "Parsing JSONL account sessions file: ", path + log "parsing JSONL account sessions file: ", path for line in path.lines: sessionPool.add parseSession(line) - log "Successfully added ", sessionPool.len, " valid account sessions." + log "successfully added ", sessionPool.len, " valid account sessions"