config options for logging

This commit is contained in:
array-in-a-matrix 2024-08-09 21:34:23 -04:00
parent b0e617f32f
commit 8f43a434bd
2 changed files with 8 additions and 0 deletions

View file

@ -17,6 +17,8 @@ type
dbDatabase*: string
# general
uploadDir*: string
enableLogs*: bool
enableErrorLogs*: bool
#! Taken from https://github.com/zedeus/nitter
@ -52,6 +54,8 @@ proc getConfig(): Cfg =
dbDatabase: config.get("Database", "dbDatabase", ""),
# general
uploadDir: config.get("General", "uploadDir", "./uploads/"),
enableLogs: config.get("General", "enableLogs", true),
enableErrorLogs: config.get("General", "enableErrorLogs", true),
)
var cfg* {.threadvar.}: Cfg

View file

@ -29,4 +29,8 @@ const defaultConf* =
[General]
; This is the path to the directory which contains all users' uploaded files.
#uploadDir = "./uploads/"
; Allows creating and logging to the log file. If this is on, it forces `enableErrorLogs` on as well.
#enableLogs = "true"
; Same as `enableLogs` but only for error or fatal messages. Forced on, if `enableLogs` is on.
#enableErrorLogs = "true"
"""