Re: Simple logging with module filename and line number

2017-10-06 Thread coffeepot
federico3: Wow, that is awesome! Love the key/value pair logging! The mention of systemd makes me think this aspect at least is only available on Linux though, right?

Re: Simple logging with module filename and line number

2017-10-05 Thread federico3
Spam: if you need more logging helpers: [https://github.com/FedericoCeratto/nim-morelogging](https://github.com/FedericoCeratto/nim-morelogging)

Re: Simple logging with module filename and line number

2017-10-05 Thread Tiberium
coffeepot: I'm afraid it isn't possible to implement it using a variable (e.g. something like $line). Yeah, it is possible to add this just as template, but I don't really think it would be accepted in stdlib

Re: Simple logging with module filename and line number

2017-10-05 Thread coffeepot
Gotta say, that is pretty slick. I love how easy it is in Nim to get info such as line numbers and stack traces, checking if variables are defined or exist and stuff like that. I'll definitely be using this. Maybe there's room for it in the logging.nim module?

Simple logging with module filename and line number

2017-10-04 Thread Tiberium
Nim allows getting a line number from a template (via compile-time information). So you can make a log template to do that: import logging, strutils var logger = newConsoleLogger(fmtStr = "[$time][$levelid]") addHandler(logger) template log*(lvl: Level, data: s