Yes it works ok we have done it as well but a common interface wouldbe convenient. Especially when opentracing whose Go libs seems to take off nicely with afaik a common interface. Logging seems even simpler.
I have started to use Zap pervasively and its typed API is very neat. fre 25 aug. 2017 kl 11:14 skrev Peter Mogensen <a...@one.com>: > > > On 2017-08-25 10:45, Henrik Johansson wrote: > > Me neither but it can be very neat occasionally. > > > > Agreed and it also applies fine things like Tracing. > > But logger? If you change logger implementation you have to have a > > wrapper or you have to change the type conversions everywhere. > > But isn't that a general problem - regardless of the specific question > of this thread. > I just keep logging concerns for the application. On the rare occasions > logging from a library is useful, I provide an API to set a callback > with a simple generic interface. > Like SetLogger(func(int level, msg string)) > If rewriting to change logger implementation is intolerable to the > application, the application could define its own interface to a logging > abstraction. > > /Peter > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.