dd-trace-go icon indicating copy to clipboard operation
dd-trace-go copied to clipboard

question: can you make log.UseLogger public API?

Open kaiquegarcia opened this issue 2 years ago • 3 comments

Hello everyone. I think would be awesome if we could change the logger like you guys did in the tests, using the function UseLogger: https://github.com/DataDog/dd-trace-go/blob/87a049b142096148eee1c1aae57195aa2a6e3eae/internal/log/log.go#L41

But we can't do it, internal pkg means internal stuff indeed. And we have a problem 'cause the current log pattern is way different from what we're using here. We're disabling for a while.

Is there any workaround to inject our logger into it?

Thanks.

kaiquegarcia avatar Jun 08 '22 16:06 kaiquegarcia

Can you not use https://pkg.go.dev/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer#WithLogger ?

gbbr avatar Jun 09 '22 13:06 gbbr

Hi @gbbr. I'm sorry, I forgot to mention I want to change the logger from profiler pkg. https://pkg.go.dev/gopkg.in/DataDog/dd-trace-go.v1/profiler#Option

This StartOption doesn't work as profiler.Option.

kaiquegarcia avatar Jun 09 '22 16:06 kaiquegarcia

I'll add that to the profiler to match the tracer 👍

nsrip-dd avatar Jun 09 '22 17:06 nsrip-dd