FedericoCeratto / nim-morelogging

Logging library for Nim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage example in README.adoc fails to compile

wizzardx opened this issue · comments

For this code:

import morelogging as log

let log = newAsyncFileLogger()
log.debug("debug")
log.info("info")
log.warn("warn")
log.error("error")
log.fatal("fatal")

The current stable Nim (0.19.4) fails with this error:

test.nim(3, 5) Error: redefinition of 'log'; previous declaration here: test.nim(3, 4)

I think it's referring to the module import and a variable being declared with the same name, 'log', meaning the 'previous declaration' location in the error is incorrect, and should be pointing to the earlier 'import' line instead.

Fixed, thanks.