Skip to content

feat: add console redis log and error log#911

Merged
wakonig merged 1 commit into
mainfrom
feature/console_redis_log
May 26, 2026
Merged

feat: add console redis log and error log#911
wakonig merged 1 commit into
mainfrom
feature/console_redis_log

Conversation

@wakonig
Copy link
Copy Markdown
Member

@wakonig wakonig commented May 22, 2026

Description

Adding console and console_error logs to redis. This will allow us to forward these logs also to grafana.

Type of Change

  • Move console log to pre_run cell
  • Add console_error log level

How to test

  • Run unit tests
  • Open the ipython client, enter something, create some errors and verify that you see it in the console log file.

Definition of Done

  • Documentation is up-to-date.

@wakonig wakonig force-pushed the feature/console_redis_log branch from 3d82e68 to 561235c Compare May 26, 2026 07:42
@wakonig wakonig marked this pull request as ready for review May 26, 2026 07:55
Copilot AI review requested due to automatic review settings May 26, 2026 07:55
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 72.34043% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bec_ipython_client/bec_ipython_client/main.py 53.33% 6 Missing and 1 partial ⚠️
bec_lib/bec_lib/logger.py 81.25% 2 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@wakonig wakonig self-assigned this May 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the logging pipeline so IPython console input and console errors are published to Redis (and therefore can be forwarded to Grafana), alongside adding a dedicated CONSOLE_LOG_ERROR level and updating log message typing to support the new log type.

Changes:

  • Add CONSOLE_LOG_ERROR log level and a dedicated Redis sink for console-level logs in BECLogger.
  • Extend LogMessage.log_type to include console_log_error.
  • Update IPython client to log console input before execution and to publish exception details as CONSOLE_LOG_ERROR, with new unit tests for both logger and client behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
bec_lib/bec_lib/logger.py Adds CONSOLE_LOG_ERROR, refactors Redis publishing into _publish_log_message, and introduces console-specific Redis sink + filtering.
bec_lib/bec_lib/messages.py Extends LogMessage.log_type Literal to accept console_log_error.
bec_lib/tests/test_bec_logger.py Adds unit tests validating console Redis callback behavior and failure handling.
bec_ipython_client/bec_ipython_client/main.py Moves console input logging to pre_run_cell and adds log_console_error + exception-handler integration.
bec_ipython_client/tests/client_tests/test_bec_client.py Adds tests asserting exception handler logs CONSOLE_LOG_ERROR for key error types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bec_lib/tests/test_bec_logger.py Outdated
Comment thread bec_lib/bec_lib/logger.py
Comment thread bec_lib/bec_lib/logger.py Outdated
Comment thread bec_ipython_client/bec_ipython_client/main.py
@wakonig wakonig force-pushed the feature/console_redis_log branch from 561235c to 9273338 Compare May 26, 2026 08:02
@wakonig wakonig requested a review from a team May 26, 2026 08:04
@wyzula-jan wyzula-jan self-requested a review May 26, 2026 10:50
Copy link
Copy Markdown
Contributor

@wyzula-jan wyzula-jan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works as expected.

@wakonig wakonig merged commit 81900fd into main May 26, 2026
36 of 37 checks passed
@wakonig wakonig deleted the feature/console_redis_log branch May 26, 2026 10:50
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.

3 participants