Skip to content

Commit 4f9ba9c

Browse files
committed
Always print sessions logs
1 parent cb334a7 commit 4f9ba9c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/auth.nim

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var
2727
enableLogging = false
2828

2929
template log(str: varargs[string, `$`]) =
30-
if enableLogging: echo "[sessions] ", str.join("")
30+
echo "[sessions] ", str.join("")
3131

3232
proc snowflakeToEpoch(flake: int64): int64 =
3333
int64(((flake shr 22) + 1288834974657) div 1000)
@@ -188,15 +188,15 @@ proc initSessionPool*(cfg: Config; path: string) =
188188
enableLogging = cfg.enableDebug
189189

190190
if path.endsWith(".json"):
191-
echo "[sessions] ERROR: .json is not supported, the file must be a valid JSONL file ending in .jsonl"
191+
log "ERROR: .json is not supported, the file must be a valid JSONL file ending in .jsonl"
192192
quit 1
193193

194194
if not fileExists(path):
195-
echo "[sessions] ERROR: ", path, " not found. This file is required to authenticate API requests."
195+
log "ERROR: ", path, " not found. This file is required to authenticate API requests."
196196
quit 1
197197

198-
log "Parsing JSONL account sessions file: ", path
198+
log "parsing JSONL account sessions file: ", path
199199
for line in path.lines:
200200
sessionPool.add parseSession(line)
201201

202-
log "Successfully added ", sessionPool.len, " valid account sessions."
202+
log "successfully added ", sessionPool.len, " valid account sessions"

0 commit comments

Comments
 (0)