Skip to content

Commit

Permalink
change log filter/ModuleFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Mar 9, 2024
1 parent b430510 commit fe77f9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub trait Filter: Send + Sync {
/// use fast_log::Config;
/// use fast_log::filter::ModuleFilter;
/// let filter = ModuleFilter::new();
/// filter.add(module_path!());
/// filter.modules.push(module_path!().to_string());
/// fast_log::init(Config::new().console().add_filter(filter)).unwrap();
/// }
/// ```
Expand All @@ -24,10 +24,6 @@ impl ModuleFilter {
pub fn new() -> Self {
Self { modules: SyncVec::new() }
}

pub fn add(&self, module: &str) {
self.modules.push(module.to_string());
}
}

impl Filter for ModuleFilter {
Expand Down
2 changes: 1 addition & 1 deletion tests/filter_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod test {
#[test]
fn test_send_pack() {
let m = ModuleFilter::new();
m.add( module_path!());
m.modules.push(module_path!().to_string());
pub struct A{}
impl LogAppender for A{
fn do_logs(&self, _records: &[FastLogRecord]) {
Expand Down

0 comments on commit fe77f9a

Please sign in to comment.