-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support loguru
log capture
#28
Labels
enhancement
New feature or request
Milestone
Comments
Further API discussion and feedback from |
Proposed APIfrom logot.contrib.loguru import LoguruCapture
with Logot().capturing(LoguruCapture):
pass Any arguments given to |
This was referenced Jan 28, 2024
etianen
added a commit
that referenced
this issue
Jan 28, 2024
Although it's neat to validate all `int` log levels are registered with the `logging` module, this falls flat for 3rd party logging frameworks (e.g. `loguru`, see #28)
etianen
added a commit
that referenced
this issue
Jan 28, 2024
…ackends (#38) - Added `Captured`, representing an abstract captured log. - Added `_format` internal module, providing shared formatting logic for `__str__` implementations. - Bulk-renaming to represent decoupling from `logging` module. 😅 - Removed log de-duplication, since it's non-portable and shouldn't be a problem for users / is actually a feature. - Added "Log capturing" docs page. This is needed by #28.
etianen
added a commit
that referenced
this issue
Jan 29, 2024
`Captured` now takes an explicit `levelname` and `levelno`. This allows 3rd-party logging framework integrations to be freed of the obligation to match stdlib `logging` levels. The validation of `validate_levelno` was relaxed to just validate the type of the input, and correspondingly renamed to `validate_level`. The `DEFAULT_XXX` class attributes on `Logot` were updated to prefer `str` and use string constants for easier reading in docs. The typing of log levels everywhere was updated to prefer `str` for better compatibility with 3rd-party logging frameworks. The named logging helpers in `logged` were updated to use string level names for better compatibility with 3rd-party logging frameworks. Needed by #28.
etianen
added a commit
that referenced
this issue
Feb 2, 2024
- Reduced dependency on stdlib `logging` module to hopefully remove all runtime dependencies when using 3rd-party logging frameworks (see #28) - No longer using `logging.getLoggerName()` to format log levels. - No longer supporting `logging.Logger` type in default `Logot` class attrs. - Added `pytest` fixtures and config for `Logot` configuration - Tested using `pytester` fixture. - Updated docs.
Merged
This was referenced Feb 5, 2024
Merged
etianen
added a commit
that referenced
this issue
Feb 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Supporting a basic loguru integration would be very easy by providing a context manager via a helper func using their
LogHandler
integration.Alternatively, a
Logot
subclass calledLogurot
would be cheese and fun. That would allow thepytest
plugin to provide alogurot
fixture too (ifloguru
is installed).The text was updated successfully, but these errors were encountered: