Skip to content

Commit

Permalink
Avoid duplicate log messages in Jupyter
Browse files Browse the repository at this point in the history
When a rich console is created within a jupyter notebook, it autodetects
the environment and outputs log messages by default, which ends up
duplicating our messages, because we already have a standard output by
default. A flag can be set to false to inhbit the autodetection.

Signed-off-by: Lucas Heitzmann Gabrielli <[email protected]>
  • Loading branch information
lucas-flexcompute committed Oct 31, 2023
1 parent 9e93740 commit c328507
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

### Fixed
- Fixed the duplication of log messages in Jupyter when `set_logging_file` is used.

## [2.5.0rc2] - 2023-10-30

Expand Down
2 changes: 1 addition & 1 deletion tidy3d/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def set_logging_file(
log.error(f"File {fname} could not be opened")
return

log.handlers["file"] = LogHandler(Console(file=file), level)
log.handlers["file"] = LogHandler(Console(file=file, force_jupyter=False), level)


# Initialize Tidy3d's logger
Expand Down

0 comments on commit c328507

Please sign in to comment.