Skip to content

Commit 8eee2c8

Browse files
niechenclaude
andcommitted
Include timestamp and class name in log format
- Enable timestamp display in Rich logging handler - Add module/class name to log format using %(name)s - Maintain clean output while providing better debugging info - Format shows: [timestamp] LEVEL module.name: message Example output: [07/04/25 15:10:14] INFO mcpm.commands.run: Server started successfully 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 09d06ab commit 8eee2c8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/mcpm/utils/logging_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ def setup_logging() -> None:
2424
debug_enabled = is_debug_enabled()
2525
log_level = os.getenv("MCPM_LOG_LEVEL", "DEBUG" if debug_enabled else "INFO")
2626

27-
# Create Rich handler with simple configuration
27+
# Create Rich handler with timestamp and class information
2828
handler = RichHandler(
2929
console=Console(stderr=True),
3030
rich_tracebacks=True,
31-
show_time=False, # Keep output clean
32-
show_path=False, # Keep output clean
31+
show_time=True, # Show timestamps
32+
show_path=False, # Keep path clean
3333
)
3434

35-
# Configure root logger
35+
# Configure root logger with timestamp and class name format
3636
logging.basicConfig(
3737
level=log_level,
38-
format="%(message)s",
38+
format="%(name)s: %(message)s", # Include class/module name
3939
handlers=[handler],
4040
force=True, # Replace any existing handlers
4141
)

0 commit comments

Comments
 (0)