feat(logger): add PICOCLAW_LOG_FILE env var for file-only logging#1828
Open
liuy wants to merge 1 commit intosipeed:mainfrom
Open
feat(logger): add PICOCLAW_LOG_FILE env var for file-only logging#1828liuy wants to merge 1 commit intosipeed:mainfrom
liuy wants to merge 1 commit intosipeed:mainfrom
Conversation
10 tasks
Collaborator
Related PR: #1853This PR has a dependency relationship with #1853 (feat(logging): add configurability for log levels preference). Conflict AnalysisBoth PRs modify
Recommended Merge Order#1853 should be merged first, then this PR needs to be rebased. Reason:
Suggested Integration (after #1853 is merged)```go } Feature Summary
These two features are complementary and work together: config.json: {"log_level": "debug"} # #1853: logs at debug level``` |
Collaborator
|
@liuy plz resolve conflicts. |
- Add PICOCLAW_LOG_FILE environment variable for configuring log file path - Add ConfigureFromEnv() function to read log config from environment - Add DisableConsole() to suppress console output - Add TestDisableConsole, TestConfigureFromEnv, TestConfigureFromEnvNoEnv tests - Merge main branch tests: TestDefaultLevelIsInfo, TestParseLevelValid, TestParseLevelInvalid, TestSetLevelFromString - Reorder: LoadConfig before ConfigureFromEnv per PR review
18d9f0b to
553bece
Compare
Contributor
Author
Done as commented |
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.
Summary
Add file-only logging support for picoclaw agent via
PICOCLAW_LOG_FILEenvironment variable.Motivation
Currently picoclaw agent outputs all logs to stdout/console, which can interfere with interactive use cases (e.g., TUI scenarios). Users need a way to redirect logs to a file only.
Usage
PICOCLAW_LOG_FILE=/tmp/agent.log picoclaw agent PICOCLAW_LOG_FILE=~/.picoclaw/logs/agent.log picoclaw agent