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

Refactor logging #16

Open
adamcharnock opened this issue Jan 11, 2020 · 0 comments
Open

Refactor logging #16

adamcharnock opened this issue Jan 11, 2020 · 0 comments

Comments

@adamcharnock
Copy link
Owner

Lightbus' logging system needs a major refactoring, or perhaps completely tearing our and reimplementing. It was one of the first areas implemented and I've been papering over the cracks since then.

I've marked this as a 'good first issue', but the caveat being that you'll need a decent understanding of Python's logging system.

Existing problems

  • Cannot use placeholders in log messages (e.g. %). This means all messages must be formatted strings, regardless of whether the message will be logged or not. This impacts performance.

Existing features (to keep)

I want the following (currently existing) features to also be present in the new system:

  • Coloured output based on log level (TTY only)
  • Emoji output (TTY only) – May sound silly, but this has really helped me scan through the logging output
  • Bold text (TTY only)
  • Bulleted lists (TTY only)

New features

Addendum

Having reviewing the logging code it actually doesn't look too bad. I'd be tempted to:

  • Refactor LBullets into LogList and LogMapping
  • Separate out logic for rendering to tty vs non-tty.
  • Go through the code and refactor/document anything non-obvious
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant