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

Go 1.21 slog #936

Closed
rogeralsing opened this issue Nov 18, 2023 · 3 comments
Closed

Go 1.21 slog #936

rogeralsing opened this issue Nov 18, 2023 · 3 comments

Comments

@rogeralsing
Copy link
Collaborator

rogeralsing commented Nov 18, 2023

I would like to get rid of the old home-baked logging used in proto.actor.
Now there is proper structured logging built into go 1.21. which seems like a very good option to aim for.

It would be great if we can discuss how this transition would go, should we keep the log.go files and just replace the inner using to use slog?
How should we set up the defaults, e.g. just use slog.Default() ? or something custom?

Everyone join in and discuss

@rogeralsing
Copy link
Collaborator Author

@rogeralsing
Copy link
Collaborator Author

Work in progress effort:

#937

In this PR. I made it so that users can set a LoggerFactory on the actor system Config.
This allows you to tweak the logger in any way you want.
The logger instance is then stored on the actor system itself. and re-used from there for all other modules.

@nightwolfz
Copy link
Contributor

nightwolfz commented Nov 22, 2023

This would create a convention of passing context to all actors methods in order to use the logger.
Not necessarily a bad thing.... just a heads up :)

Personally I like to keep it simple (switched custom logger to zap)

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