Skip to content

Commit d71c6e8

Browse files
phernandezclaude
andcommitted
fix: suppress CLI warnings for cleaner output
Suppress DeprecationWarning from aiosqlite and LogfireNotConfiguredWarning that were cluttering CLI output. The key fix is applying warnings.filterwarnings("ignore") AFTER all imports in main.py, because authlib (imported via cloud commands) adds a DeprecationWarning filter that overrides earlier suppressions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 63b9849 commit d71c6e8

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/basic_memory/cli/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Suppress Logfire "not configured" warning - we only use Logfire in cloud/server contexts
2+
import os
3+
4+
os.environ.setdefault("LOGFIRE_IGNORE_NO_CONFIG", "1")
5+
16
# Remove loguru's default handler IMMEDIATELY, before any other imports.
27
# This prevents DEBUG logs from appearing on stdout during module-level
38
# initialization (e.g., template_loader.TemplateLoader() logs at DEBUG level).

src/basic_memory/cli/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
tool,
1717
)
1818

19+
# Re-apply warning filter AFTER all imports
20+
# (authlib adds a DeprecationWarning filter that overrides ours)
21+
import warnings # pragma: no cover
22+
23+
warnings.filterwarnings("ignore") # pragma: no cover
24+
1925
if __name__ == "__main__": # pragma: no cover
2026
# start the app
2127
app()

0 commit comments

Comments
 (0)