sadlil/gologger

Feature: logger.Add(otherLogger)

Opened this issue · 1 comments

Hi!

I really like the simplicity of your library. A small thought/idea:

It might be helpful if it is possible to add a logger to another one, to only use one logging statement to write to both targets, i.e.:

logger1 = gologger.GetLogger(gologger.CONSOLE, gologger.SimpleLog)
logger1.Add(gologger.GetLogger(gologger.FILE, "filelog.log"))

logger1.log("Hello Console") // logs into console and file.

Just wanted to put this up for discussion, would love to hear your opinion on this!

Hi @sauercrowd Sorry for my late reply, This lib was designed on purpose for learning go with the simplest apis possible. There are a lot of good go logging library available like zap, glog. I don't think i would like to maintain this library any more unless i come up with some really good and production ready feature updates. Meanwhile also need some free time despite of being a new Dad 💘.

I really like your idea of logger.Add. If you want to have this features feel free to send a PR i would definitely like to merge.