Crates.io | parse-env-filter |
lib.rs | parse-env-filter |
version | 0.1.0 |
source | src |
created_at | 2021-09-07 03:41:05.544523 |
updated_at | 2021-09-07 03:41:05.544523 |
description | parser for the env logger filter format |
homepage | |
repository | https://github.com/CAD97/tracing-utils/tree/main/libs/parse-env-filter |
max_upload_size | |
id | 447839 |
size | 26,010 |
Parsing support for a log target filter, as used by env_logger and tracing::EnvFilter.
We always support the extended tracing format, that is
target[span{field=value}]=level
with the following validity rules:
[]{}=,"/
value
and/or quoting valuesNote that these rules do not trim whitespace; you'll likely want to yourself. If you want further verification, you can add it on after the parse step. This crate is merely intended to pull the directives out of the format, not to ensure that the directives are otherwise well-formed or meaningful.
/regex
directive to filter messages via a regex. This applies
separately and to all other earlier directives, and as such doesn't quite fit the filter
iterator design we've taken. However, we have reserved the /
character for clarity
and such that a filter field can potentially be added with this syntax in the future.