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

Use standard logging format #26

Merged
merged 3 commits into from
Mar 10, 2023
Merged

Conversation

Mihai22125
Copy link
Contributor

Resolves #24

  • Standardize logs from handlers package

@VTGare
Copy link
Owner

VTGare commented Nov 28, 2022

Other than that it looks good, thanks for adding extra context and fixing minor spelling mistakes. :)

func OnReady(b *bot.Bot) func(*discordgo.Session, *discordgo.Ready) {
return func(s *discordgo.Session, r *discordgo.Ready) {
b.Log.Infof("%v is online. Session ID: %v. Guilds: %v", r.User.String(), r.SessionID, len(r.Guilds))
b.Log.With("user", r.User.String(), "session_id", r.SessionID, "guilds", len(r.Guilds)).Info("user is online")
Copy link
Owner

Choose a reason for hiding this comment

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

This log is for the bot shard successfully connecting to the Discord API. Logging "shard is connected" is better here.

handlers/handlers.go Outdated Show resolved Hide resolved
@VTGare VTGare merged commit acb1b18 into VTGare:master Mar 10, 2023
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.

Use standard logging format
2 participants