Skip to content

[Bug] logger.catch() dosn't colored error traceback #52

@aiwonderland

Description

@aiwonderland

Describe the Bug

logger.catch() in errortools.logging submodule dosn't colored error traceback.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Run '....' Run code in README:
from errortools.logging import logger

logger.info("Server started on port {}", 8080)
logger.add("app.log", rotation=10_485_760, retention=5)
with logger.catch():
    int("not a number")                     # logged + suppressed
  1. See error:
2026-05-29 10:55:43.650 | ℹ INFO     | <string>:<module>:3 - Server started on port 8080
2026-05-29 10:55:43.650 | ✘ ERROR    | base:__exit__:392 - An error has been caught in function '<module>', process '5756', thread 'MainThread'
Traceback (most recent call last):
  File "<string>", line 6, in <module>
    int('not a number')
    ~~~^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'not a number'

The Traceback has no color!

Environment

- OS: [e.g. Ubuntu 22.04, Windows 11, macOS] It's irrelevant
- Python version: [e.g. 3.10, 3.11, 3.12] It's irrelevant

  • Package version: 3.2.0

Additional Context

Nothing

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions