fix: Respect BASIC_MEMORY_LOG_LEVEL and BASIC_MEMORY_CONSOLE_LOGGING environment variables#264
Merged
Merged
Conversation
…environment variables Resolves #255 where console logging configuration was not properly respecting environment variables. Changes: - BASIC_MEMORY_LOG_LEVEL environment variable is now read and used before falling back to config file - BASIC_MEMORY_CONSOLE_LOGGING now accepts multiple truthy values: "true", "1", "yes", "on" (case-insensitive) - Fixed timing issue where logging setup occurred before environment variables could be processed The logging setup function now directly reads environment variables first, ensuring user settings are respected immediately during application startup. Signed-off-by: Claude <noreply@anthropic.com> 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Joe P <joe@basicmemory.com>
d7f0021 to
3967bd7
Compare
groksrc
pushed a commit
that referenced
this pull request
Aug 25, 2025
…environment variables (#264) Signed-off-by: Joe P <joe@basicmemory.com> Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Drew Cain <groksrc@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.
Summary
Fixes #255 - Console logging was ignoring
BASIC_MEMORY_CONSOLE_LOGGING=falseandlog_level=ERRORsettings.Root Cause
The logging setup function was not properly reading environment variables before falling back to config file settings. This was due to a timing issue where logging setup occurred during module import before environment variables could be processed through Pydantic's settings system.
Changes Made
Environment Variable Support:
BASIC_MEMORY_LOG_LEVELenvironment variable is now properly read and usedBASIC_MEMORY_CONSOLE_LOGGINGnow accepts multiple truthy values:"true","1","yes","on"(case-insensitive)Technical Implementation:
setup_basic_memory_logging()insrc/basic_memory/config.pyTesting
Verified that the following configurations now work correctly:
Before vs After
Before:
BASIC_MEMORY_LOG_LEVELignored completely"true"for console loggingAfter:
BASIC_MEMORY_LOG_LEVEL=ERRORcorrectly filters to ERROR+ onlyBASIC_MEMORY_CONSOLE_LOGGING=falseproperly disables console output"true","1","yes","on"for console loggingTest plan
🤖 Generated with Claude Code