Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Add support for changing default colour mapping #82

Closed
oDn opened this issue Mar 1, 2018 · 1 comment
Closed

Add support for changing default colour mapping #82

oDn opened this issue Mar 1, 2018 · 1 comment

Comments

@oDn
Copy link

oDn commented Mar 1, 2018

Unless I missed something, there is no direct method to map different colours depending on the log level without extending the LogFormatter class.

@metachris
Copy link
Owner

metachris commented Oct 16, 2020

See #341

With this PR, it would work like this to change the error color:

import logzero
import logging
logzero.DEFAULT_COLORS[logging.ERROR] = logzero.ForegroundColors.GREEN

# Now the new colors will already be used:
logzero.logger.error('123')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants