getsentry / sentry-go

The official Go SDK for Sentry (sentry.io)
https://docs.sentry.io/platforms/go/
MIT License
880 stars 207 forks source link

Remove global Logger #182

Open rhcarvalho opened 4 years ago

rhcarvalho commented 4 years ago

A global Logger in a library like sentry-go poses some problems.

Random thoughts

Our logging usage is small. There are <30 calls to Logger.Print*. Possibly all messages would fit a "INFO" level (but we can leave that to package main, i.e. users, to decide what logging facility to use). We may or may not embrace some form of structured logging.

One way to allow users of sentry-go to plug-in their own loggers is to make the SDK depend on a simple interface that can be easily implemented by actual loggers.

At the moment we log from client and transport, hub and scope, and integrations (perhaps oddly including the fasthttp integration). We may need to change some of those log calls.

A call to sentry.Init might take a logger and share it with components it initializes: the default integrations, client, transport, hub, scope, etc.

We may provide a simple way to write to os.Stderr (see #154) for easy debugging.

Resources

github-actions[bot] commented 1 year ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀