Allow two getLogger() entrypoints

This commit is contained in:
Gustavo Cordova Avila
2024-04-12 13:40:29 -07:00
parent dfbad6693a
commit a94ac79946
3 changed files with 15 additions and 3 deletions

View File

@@ -116,8 +116,13 @@ proc setLogOutputFormat*(fmt: string) =
################################################################
## Create a new logger object.
##
proc getLogger*(name: string; extra: varargs[KVPair]): Logger =
## Return a logger object
proc getLogger*(name: string): Logger =
## Return a logger
new(result)
result.name = name
proc getLogger*(name: string; extra: openarray[KVPair]): Logger =
## Return a logger object with some extra stuff
new(result)
result.name = name
result.extra.add(extra)