Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Aug 16, 2024
1 parent 0a7192e commit e15a9b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions log/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Each entry must include the Github issue reference in the following format:

## [Unreleased]

## [v1.4.1](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.4.1) - 2024-08-16

* [#21326](https://github.com/cosmos/cosmos-sdk/pull/21326) Avoid context key collision.

## [v1.4.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.4.0) - 2024-08-07

* [#21045](https://github.com/cosmos/cosmos-sdk/pull/21045) Add `WithContext` method implementations to make all returned loggers compatible with `cosmossdk.io/core/log.Logger` (v1) without a direct dependency.
Expand Down
4 changes: 3 additions & 1 deletion log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ func init() {
const ModuleKey = "module"

// ContextKey is used to store the logger in the context.
var ContextKey struct{}
var ContextKey contextKey

type contextKey struct{}

// Logger is the Cosmos SDK logger interface.
// It extends cosmossdk.io/core/log.Logger to return a child logger.
Expand Down
2 changes: 1 addition & 1 deletion tools/cosmovisor/cmd/cosmovisor/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestVersionCommand_Error(t *testing.T) {
rootCmd.SetOut(out)
rootCmd.SetErr(out)

ctx := context.WithValue(context.Background(), log.ContextKey, logger)
ctx := context.WithValue(context.Background(), log.ContextKey, logger) //nolint:staticcheck issue in dependency

require.Error(t, rootCmd.ExecuteContext(ctx))
require.Contains(t, out.String(), "DAEMON_NAME is not set")
Expand Down

0 comments on commit e15a9b5

Please sign in to comment.