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

Support loguru-style message matching #31

Closed
etianen opened this issue Jan 27, 2024 · 1 comment
Closed

Support loguru-style message matching #31

etianen opened this issue Jan 27, 2024 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@etianen
Copy link
Owner

etianen commented Jan 27, 2024

Originally intended as be part of #28, this has been moved to a separate issue following discussion with loguru devs in Delgan/loguru#1072. 👍

Proposed API

Support .format()-style placeholders like this:

from logot.contrib.loguru import logged

logot.wait_for(logged.info("Hello {}"))

Support matching structured data like this (requires #25):

logot.wait_for(
    logged.bind(foo="bar").info("Hello {}")
)

Implementation

Parsing of the format-style placeholders should be nice and easy using string.Formatter.parse(). Probably easier than the normal %-style placeholder parsing!

@etianen etianen added the enhancement New feature or request label Jan 27, 2024
@etianen etianen added the wontfix This will not be worked on label Feb 15, 2024
@etianen
Copy link
Owner Author

etianen commented Feb 15, 2024

Matching the style of every 3rd-party log integration is going to get tedious. Let's not.

@etianen etianen closed this as completed Feb 15, 2024
@etianen etianen closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2024
etianen added a commit that referenced this issue Feb 25, 2024
This will make adding new features such as #25, #26 and #80 easier.

It also opens the door to #31 and #124, if desired in future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant