Skip to content

Forward client browser messages to server console in --debug mode#15

Open
erwanp wants to merge 7 commits intomainfrom
add/forward-browsers-errors-to-server-console
Open

Forward client browser messages to server console in --debug mode#15
erwanp wants to merge 7 commits intomainfrom
add/forward-browsers-errors-to-server-console

Conversation

@erwanp
Copy link
Contributor

@erwanp erwanp commented Aug 14, 2025

Add Console Forwarding for Debug Mode

Overview

Adds browser console message forwarding to Boulder when running with --debug. Browser console messages (logs, warnings, errors) are automatically captured and forwarded to the server console with timestamps and color coding.

Problem

Browser console messages are only visible in browser dev tools, making remote debugging difficult and preventing correlation with server-side logs.

Solution

Conditional console forwarding system that activates only with --debug flag, captures all console methods, forwards via HTTP POST, and formats output with timestamps and colors.

Changes

  • boulder/app.py: Added debug mode tracking and conditional callback registration
  • boulder/callbacks/console_callbacks.py: NEW - Flask route /console_forward for message handling
  • boulder/layout.py: Conditional script inclusion when debug mode enabled
  • boulder/callbacks/__init__.py: Updated callback registration

Usage

boulder --debug  # Enable console forwarding

Features

  • All console methods (log, error, warn, info, debug)
  • [x]Color-coded output (red=error, yellow=warn, blue=info, gray=debug)
  • Timestamps and source location
  • Unhandled error capture
  • Zero production impact (only active with --debug)
  • (unrelated) also untracked version.py (shouldn't have been)

@erwanp erwanp force-pushed the add/forward-browsers-errors-to-server-console branch 4 times, most recently from 5f09fac to 486cd8b Compare August 17, 2025 15:28
@erwanp erwanp force-pushed the add/forward-browsers-errors-to-server-console branch from deae166 to 7ecfd66 Compare August 17, 2025 19:08
erwanp added 3 commits August 18, 2025 08:54
upload config file during tests

(it was not failing before we implemenetd create_app; because app was global and re-used from one test to another, and therefore config file was already loaded)
fix test , change relative import to absolute,

trying to fix tests

update tests

Revert "trying to fix tests"

This reverts commit 8edd3b3.

Update test_e2e.py

Update test_e2e.py
@erwanp erwanp force-pushed the add/forward-browsers-errors-to-server-console branch from 8c622ca to f209abb Compare August 18, 2025 06:59
@erwanp erwanp force-pushed the add/forward-browsers-errors-to-server-console branch from f209abb to dc90e19 Compare August 18, 2025 07:53
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.

1 participant