Skip to content

Conversation

@aarongable
Copy link
Contributor

Note

This is a work in progress. Not ready for real review, but open to structural feedback.

Fixes #8557


import "log/slog"

func AcctAttr(acctID int) slog.Attr {
Copy link
Contributor

Choose a reason for hiding this comment

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

If these were in a package attr, you could invoke them as attr.Acct()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the thought occurred to me, but I'm not sure that a type name that is shorter but doesn't include the word "log" is really worth it. Could go either way.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm inclined to go with the package name attr.Acct() (these will always and only show up in the context of a log line). Though there's a third contender: log.Acct(). Or in practice blog.Acct() since we usually rename this import.

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

Successfully merging this pull request may close these issues.

logging: Switch to slog

4 participants