Skip to content
New issue

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

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

Already on GitHub? # to your account

Expose the underlying slog logger to the dev server #731

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

bergundy
Copy link
Member

Also upgrade server to v1.26.2-rc.0.

The server depends on the Nexus SDK, which expects an slog.Logger, the server will do best effort conversion from common/log.Log to slog.Logger but providing access to the underlying slog.Logger gives better control that the default shim provided by the server.

Comment on lines +29 to +31
func (s slogLogger) SLog() *slog.Logger {
return s.log
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive the probably-dumb Go question, but I don't understand how this is being used? Is there some magic somewhere that's calling this function?

Copy link
Member

@cretz cretz Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, it's being used in the server code. So we pass a log.Logger to the server, and server-side they see if it's also a log.SLogWrapper they call this to extract the slog. (this package is where we programmatically use the server like a library)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bergundy bergundy merged commit e110570 into temporalio:next-server Dec 19, 2024
6 checks passed
@bergundy bergundy deleted the slog-integration branch December 19, 2024 17:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants