Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colored logs #272

Open
wsw70 opened this issue Aug 24, 2018 · 1 comment
Open

Colored logs #272

wsw70 opened this issue Aug 24, 2018 · 1 comment

Comments

@wsw70
Copy link

wsw70 commented Aug 24, 2018

Is it possible to output colored logs with Logbook?

The standard logging module has coloredlogs but it is not compatible with Logbook.

@Kristinita
Copy link

@wsw70,

1. Solution

For colored logs I use Pyfancy.

Pyfancy demonstration

import sys

from logbook import Logger
from logbook import StreamHandler
from pyfancy.pyfancy import pyfancy

StreamHandler(sys.stdout).push_application()

Logger('Logbook').notice(pyfancy().yellow('Sasha Goddess!'))

Logger('Logbook').error(pyfancy().blue_bg().bold('Sasha Goddess!'))

2. Another packages

I create some feature requests in another Python packages for log coloring — no effect.

Thanks.

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

No branches or pull requests

2 participants