Repository navigation
Conversation
DEVELOPMENT.md documents LOG_LEVEL, but the logger was always created at info level, so LOG_LEVEL=debug had no effect. Parse it with slog.Level.UnmarshalText and fall back to info when it is unset or invalid. Closes kagent-dev#94 Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94.
DEVELOPMENT.mddocumentsLOG_LEVEL(and suggestsLOG_LEVEL=debug go run ./cmd), and the e2e helpers setLOG_LEVEL=debug, butlogger.Initalways built the handler withslog.LevelInfo, so the variable had no effect and the existingDebugcalls never printed.Initnow readsLOG_LEVELand parses it withslog.Level.UnmarshalText, sodebug,info,warnanderrorwork case-insensitively (as do slog offsets such asinfo+2). Unset or invalid values keep today's default of info. The docs line now says so.I left the Helm chart alone:
tools.loglevelinvalues.yamlis still not rendered into the Deployment, and wiring it with its current default (debug) would change the default verbosity of every install. That fits better with #92.Test:
TestInitHonorsLogLevelininternal/logger/logger_test.gochecks which levels are enabled for unset,debug,DEBUG,info,warn,errorand an invalid value. Onmainthedebug,DEBUG,warnanderrorcases fail; with this change all pass.go test -tags=test ./internal/... ./cmd/...,go vetandgolangci-lint run --build-tags=testpass locally.AI disclosure: written with the help of Claude Code, reviewed and tested by me.