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

Add logical operators on Filter #273

Closed
Fristi opened this issue Feb 23, 2022 · 5 comments
Closed

Add logical operators on Filter #273

Fristi opened this issue Feb 23, 2022 · 5 comments

Comments

@Fristi
Copy link

Fristi commented Feb 23, 2022

Do you think this makes sense?

def &&(other: Filter): Filter = new Filter {
  def matches[M](record: LogRecord[M]): Boolean = filter.matches(record) && other.matches(record)
}
.withModifier(exclude(packageName.startsWith("org.http4s.blaze") && level < Level.Warn))
@Fristi Fristi changed the title Add conjuction operators on Filter Add logical operators on Filter Feb 23, 2022
@darkfrog26
Copy link
Contributor

@Fristi, yes, that's a great idea. I went ahead and created a new commit to add this functionality. Take a look and let me know if there's anything I missed. Thanks for the great idea!

@Fristi
Copy link
Author

Fristi commented Feb 23, 2022

Great thanks! Maybe || as well ?

@darkfrog26
Copy link
Contributor

You went and had to make it more complicated, didn't you? :) I added || support. Let me know if you think of something else.

@Fristi
Copy link
Author

Fristi commented Feb 24, 2022

Looks great! Thanks for the quick add

Works superb with Slf4j and GraalVM

@darkfrog26
Copy link
Contributor

@Fristi, great to hear! Please feel free to make any additional suggestions or offer feedback as you continue to use Scribe. I'm always happy to hear feedback that helps make it better.

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