Skip to content

Commit

Permalink
Fix the addition of the rich handler (SkafteNicki#227)
Browse files Browse the repository at this point in the history
The handlers list is stored under logger.root, not the logger itself.
  • Loading branch information
jirkoada authored Jan 6, 2024
1 parent 8bfe69e commit 4788d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s4_debugging_and_logging/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ If you need help for the exercises you can find a simple solution script
script:

```python
logger.handlers[0] = RichHandler(markup=True) # set rich handler
logger.root.handlers[0] = RichHandler(markup=True) # set rich handler
```

and try re-running the script. Hopefully you should see something buitiful in your terminal like this:
and try re-running the script. Hopefully you should see something beautiful in your terminal like this:

<figure markdown>
![Image](../figures/rich_terminal_logging.png){ width="700" }
Expand Down

0 comments on commit 4788d7f

Please sign in to comment.