Skip to content

Commit

Permalink
fix nil *slog.Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Mar 11, 2024
1 parent 1106c2d commit 56f250c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion disgolink/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (c *clientImpl) PlayerOnNode(node Node, guildID snowflake.ID) Player {
return player
}

player := NewPlayer(c, node, guildID)
player := NewPlayer(c.logger.With(slog.String("name", "disgolink_node_player"), slog.Int64("guild_id", int64(guildID))), c, node, guildID)
c.ForPlugins(func(plugin Plugin) {
if pl, ok := plugin.(PluginEventHandler); ok {
pl.OnNewPlayer(player)
Expand Down
3 changes: 2 additions & 1 deletion disgolink/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ type Player interface {
OnVoiceStateUpdate(ctx context.Context, channelID *snowflake.ID, sessionID string)
}

func NewPlayer(lavalink Client, node Node, guildID snowflake.ID) Player {
func NewPlayer(logger *slog.Logger, lavalink Client, node Node, guildID snowflake.ID) Player {
return &playerImpl{
logger: logger,
lavalink: lavalink,
node: node,
guildID: guildID,
Expand Down

0 comments on commit 56f250c

Please sign in to comment.