Compare commits

..

No commits in common. "main" and "3.1.0" have entirely different histories.
main ... 3.1.0

2 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Package
version = "3.1.1"
version = "3.1.0"
author = "Jonathan Bernard"
description = "Lightweight Postgres ORM for Nim."
license = "GPL-3.0"

View File

@ -309,16 +309,14 @@ type
## Error type raised when no record matches a given ID
var logService {.threadvar.}: Option[LogService]
var logger {.threadvar.}: Option[Logger]
proc logQuery*(methodName: string, sqlStmt: string, args: openArray[(string, string)] = []) =
# namespaced_logging would do this check for us, but we don't want to even
# build the log object if we're not actually logging
if logService.isNone: return
if logger.isNone: logger = logService.getLogger("fiber_orm/query")
var log = %*{ "method": methodName, "sql": sqlStmt }
for (k, v) in args: log[k] = %v
logger.debug(log)
logService.getLogger("fiber_orm/query").debug(log)
proc enableDbLogging*(svc: LogService) =
logService = some(svc)