hound-search / hound

Lightning fast code searching made easy
MIT License
5.64k stars 575 forks source link

Add sane logging. #169

Open kellegous opened 8 years ago

kellegous commented 8 years ago

Sadly, I got busy after Hound's OS release and never added proper logging which would allow a log file to be written to /var/log. That needs to get added.

zmagg commented 7 years ago

@kellegous What's the approach that you were thinking about for this? Would using glog and configuring where to send the logs to using flags match what you were thinking? (https://github.com/golang/glog)

kellegous commented 7 years ago

Maybe it's a fool's errand to kick this can down the road, but Hound still has no external dependencies. I'm wondering if we can just get by with the standard golang log package to keep the dream alive a bit longer. Ultimately, I think that comes down to the question of how much we need leveled logging. Honestly, I usually feel like glog is over-kill and log is under-kill. So I guess the three realistic options are:

  1. Go ahead and tackle the external deps issue and let's have full-blown leveled logging.
  2. Just stick with straight-forward log and we don't need no stink'n levels.
  3. Put a light level wrapper around log. The hypothesis here is that the wrapper around log would be less work than tackling the external dependency issue ... but we do really want leveled logging.

Any thoughts?

zmagg commented 7 years ago

Ahhhhh.

So I'm not sure leveled logging is necessary yet for this project, I'm into #2. Taking a look around, it looks like there's some info/error modes, but that could be toggled at build time or with a runtime flag. (https://github.com/etsy/hound/blob/master/cmds/houndd/main.go#L22). I realize now that configuring to write to /var/log is independent of the log level question.

@kellegous does that sound right to you?