diff options
author | Istvan <l1x@users.noreply.github.com> | 2018-12-17 19:29:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-17 19:29:08 +0100 |
commit | 915a9ec08259c2cceccd4f46c8ed51742316390d (patch) | |
tree | dbcbe49798d27967415dc3caddb6f51a99f3a749 | |
parent | 0409f2348e2ac69a717e4ec7628a99c49fd42f0d (diff) | |
download | Nim-915a9ec08259c2cceccd4f46c8ed51742316390d.tar.gz |
Adding more documentation to logging.nim
Just minor addition to the documentation with the use of operators
-rw-r--r-- | lib/pure/logging.nim | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim index cd13deec3..febd0b602 100644 --- a/lib/pure/logging.nim +++ b/lib/pure/logging.nim @@ -12,7 +12,7 @@ ## write your own. ## ## Format strings support the following variables which must be prefixed with -## the dollar operator (``$``): +## the dollar operator (``$``, see example below): ## ## ============ ======================= ## Operator Output @@ -43,6 +43,11 @@ ## warn("4 8 15 16 23 4-- Error") ## error("922044:16 SYSTEM FAILURE") ## fatal("SYSTEM FAILURE SYSTEM FAILURE") +## # Using the aformetioned operator +## var opL = newConsoleLogger(fmtStr = "$datetime :: ") +## addHandler(opL) +## info("Starting web server...") +## # Will print something like 2018-12-17T19:28:05 :: Starting web server... ## ## **Warning:** The global list of handlers is a thread var, this means that ## the handlers must be re-added in each thread. |