Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: can you make log.UseLogger public API? #1331

Closed
kaiquegarcia opened this issue Jun 8, 2022 · 3 comments · Fixed by #1466
Closed

question: can you make log.UseLogger public API? #1331

kaiquegarcia opened this issue Jun 8, 2022 · 3 comments · Fixed by #1466
Assignees

Comments

@kaiquegarcia
Copy link

kaiquegarcia commented Jun 8, 2022

Hello everyone.
I think would be awesome if we could change the logger like you guys did in the tests, using the function UseLogger:

func UseLogger(l ddtrace.Logger) (undo func()) {

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.

@gbbr
Copy link
Contributor

gbbr commented Jun 9, 2022

@gbbr gbbr changed the title Can you move log.UseLogger out of the internal pkg? question: can you make log.UseLogger public API? Jun 9, 2022
@gbbr gbbr added the question label Jun 9, 2022
@kaiquegarcia
Copy link
Author

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.

@nsrip-dd
Copy link
Contributor

nsrip-dd commented Jun 9, 2022

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

@nsrip-dd nsrip-dd self-assigned this Jun 9, 2022
nsrip-dd added a commit that referenced this issue Jun 9, 2022
nsrip-dd added a commit that referenced this issue Sep 14, 2022
Make the internal UseLogger function public so that users can specify a
single logger for all tracer and profiler logs. Right now the profiler
doesn't have a configurable logger, and the tracer has the WithLogger
option, which sets the global logger anyway.

Fixes #1331.
knusbaum pushed a commit that referenced this issue Sep 21, 2022
Make the internal UseLogger function public so that users can specify a
single logger for all tracer and profiler logs. Right now the profiler
doesn't have a configurable logger, and the tracer has the WithLogger
option, which sets the global logger anyway.

Fixes #1331.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants