Skip to content

Conversation

@cholcombe973
Copy link

Thanks for building ftlog! I've customized it a little bit with this PR. It allows 2 types of closures (filters) to be added. The first type will drop logs before they're ever added into the pipeline. Could be useful for really spammy log entries. The second type allows setting a closure to select the Appender to use. This allows the user to use any criteria they want to redirect logs. The background for this change is I have a desire to redirect log entries based on a key/value pair that's in the log message. So instead of just filtering on the level I want to filter on the message itself.
I also added in some cargo clippy fixes and some little cleanup things.

@nonconvextech
Copy link
Owner

Could you please use cargo fmt to format the code?

Callers can add timestamp support as a field during log message
formatting.
@nonconvextech
Copy link
Owner

The idea feels great. I will test the performance impact before merging.

@rrichardson
Copy link

Since this breaks API compatibility, I might recommend adding a method in addition to filter instead of changing the filter method. Maybe filter_with.

@cholcombe973
Copy link
Author

I merged in the filter_with functionality from Rick. I think this should be good to go.

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

Successfully merging this pull request may close these issues.

3 participants