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

replace slogrus with log/slog #13

Open
uhthomas opened this issue Jun 12, 2024 · 4 comments
Open

replace slogrus with log/slog #13

uhthomas opened this issue Jun 12, 2024 · 4 comments

Comments

@uhthomas
Copy link
Contributor

slogrus is not particularly efficient and is an unnecessary external dependency which can be avoided with log/slog.

@onedr0p
Copy link
Contributor

onedr0p commented Jun 13, 2024

The unifi webhook just migrated to uber/zap. Besides performance, the logo won my choice for a logging library.

image

kashalls/external-dns-unifi-webhook@6bc8b84

@uhthomas
Copy link
Contributor Author

uhthomas commented Jun 13, 2024

Zap admittedly does have good performance, but I can guarantee logging is the least of any performance concerns. My concern here is dependency and standardisation. Their reasoning for migrating is that logrus is in maintenance mode and is therefore even more reason to replace logrus, but zap is not necessarily the obvious choice given log/slog does everything which could be needed and doesn't require an addition dependency. I really would urge the use of log/slog - it's the standard and external packages should only every be considered if performance is a concern (which it isn't). I say this as a long time user (uber-go/zap#736) and enjoyer of zap. It's just not necessary anymore.

Just to touch on performance, there isn't a meaningful difference between zap and log/slog which makes the maintenance burden worth it. Same reason every Go project uses net/http instead of fasthttp or other examples.

@onedr0p
Copy link
Contributor

onedr0p commented Jun 14, 2024

but does slog have a cool gopher logo? 🤣

@uhthomas
Copy link
Contributor Author

but does slog have a cool gopher logo? 🤣

I suppose it inherits the normal Go gopher as it's a standard library package.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants