Skip to content

Conversation

@srperens
Copy link
Collaborator

@srperens srperens commented Dec 3, 2025

Summary

  • Add automatic file logging to strom.log with auto-clear on startup
  • Reduce log verbosity by moving noisy logs from debug to trace level
  • Improves production readability and makes debugging crashes easier

Changes

File Logging (52b0b64)

  • Automatically log all output to strom.log in addition to console
  • Clear log file on startup to prevent unbounded growth
  • Makes it easier to debug crashes and review session history

Log Verbosity Reduction (44a125b, b90c1b7, 9c44cb7, 8f74cbf)

  • Move WebSocket message logs from debugtrace
  • Move link resolution logs from debugtrace
  • Move meter data logs from debugtrace
  • Move bus message type logs from debugtrace

These changes clean up the debug log output significantly while preserving all information at trace level for deep debugging.

Testing

  • Built successfully on all platforms
  • Log file creation verified
  • Debug output is now much more readable for production use

🤖 Generated with Claude Code

Per Enstedt and others added 6 commits December 3, 2025 11:23
Add comprehensive file logging support with automatic log rotation:
- File logging writes to configured path in addition to stdout
- Log file is automatically cleared on each application startup
- Configurable log level via config file or RUST_LOG env var
- Local timestamps in RFC3339 format for all log entries
- Separate formatting for console (compact) vs file (detailed)

Configuration changes:
- Add logging.log_file and logging.log_level to config
- Support via config file, environment vars, or CLI args
- Priority: RUST_LOG env > config.log_level > default "info"

Dependencies:
- Add tracing-appender for file rotation support
- Add time crate for local timestamp formatting

Updated .strom.toml.example with comprehensive logging documentation
and examples for all configuration options.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Adjust log levels for better signal-to-noise ratio:

Backend WebSocket (backend/src/api/websocket.rs):
- Change ping/pong messages from debug to trace
- Change event sending from debug to trace
- Keep connection lifecycle events at info level
- Reduces log noise during normal operation

Link Resolution (backend/src/gst/block_expansion.rs):
- Change key link resolution messages from debug to info
- Add 🔗 emoji for visual identification
- Add more context (internal_element_id, internal_pad_name)
- Makes pipeline linking more visible and debuggable

Frontend WebSocket (frontend/src/app.rs, frontend/src/ws.rs):
- Change message receive/parse from debug to trace
- Change ping/pong from debug to trace
- Reduces frontend console noise

Rationale:
- trace: Very verbose, periodic operations (ping/pong, each message)
- debug: Normal debugging context
- info: Important operations that help understand system behavior
- Link resolution is critical for understanding pipeline construction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Change high-frequency meter logging from debug to trace to reduce
log file noise.

Changes:
- Per-message level logs moved from debug to trace:
  - "Received 'level' message from GStreamer bus"
  - "Level message from element"
  - "Using block ID for lookup"
  - "Extracted values"
  - "Broadcasting MeterData event"
- One-time setup log stays at debug level
- Warning logs remain unchanged

Rationale:
Meter blocks send messages every 10-200ms depending on configuration,
generating massive amounts of debug logs. These are only useful for
deep debugging of the meter implementation itself, not general usage.

With default 100ms interval:
- Before: 10 debug logs per second per meter
- After: Silent at debug level, verbose at trace level

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Complete the meter logging cleanup by moving high-frequency logs to trace.

Changes:
Backend (backend/src/events.rs):
- Conditional broadcast logging: trace for MeterData, debug for others
- Avoids flooding logs with per-message meter broadcasts

Frontend (frontend/src/app.rs):
- "METER DATA RECEIVED" moved from debug to trace
- "Meter data stored" moved from debug to trace

Frontend (frontend/src/meter.rs):
- show_compact() rendering moved from debug to trace
- show_full() rendering moved from debug to trace

Impact:
With 2 meters at 100ms interval:
- Before: 40+ debug logs per second (backend + frontend)
- After: Silent at debug level, verbose at trace level

This completes the meter logging refactor started in commit 50148dd,
which moved the backend meter block logs to trace.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Change high-frequency bus message logging to trace level to reduce log noise.

Change:
- "Bus message type: {:?}" moved from debug to trace

Impact:
GStreamer elements send continuous bus messages during playback:
- Element messages (stats, level data, etc.)
- Tag messages (metadata)
- State change messages
- QoS messages

With active flows, this generates hundreds of debug logs per second.
These logs are only useful for deep GStreamer debugging, not general usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@srperens srperens merged commit c953c6a into main Dec 3, 2025
8 of 9 checks passed
@srperens srperens deleted the logging-improvements branch December 4, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants