Closed brandonblock closed 7 years ago
Hi Brandon. Actually, log.Hooks.Add
is not deprecated :)
addHook
will only work if the import is named log
(which is the case here), because it's a package function.
To add a hook to a logger (which is not necessary the std one), Hooks.Add
must be used.
In other words, the current version is more portable, and will work either with a named import or a custom logger.
Makes sense?
Thanks :)
refs:
Yup, makes sense... except the example as-is won't work, right? There's no package level function name "Hooks." I guess what I'm saying is that the example doesn't build or run.
Ho, good catch... Sorry, you're absolutely right :)
Thanks !
Thanks for maintaining this project!
Just notice that the readme uses an older logrus function