Skip to content

Commit

Permalink
Restore global_filter feature
Browse files Browse the repository at this point in the history
Split layer.rs into smaller files
Make EtwLayer and EtwFilter more common
  • Loading branch information
Robo210 committed Aug 24, 2024
1 parent 6bd84d0 commit e75ae5e
Show file tree
Hide file tree
Showing 8 changed files with 686 additions and 642 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ authors = ["Kyle Sabo", "Microsoft"]
crate-type = ["rlib"]

[features]
global_filter = []
common_schema = []
default = ["common_schema"]

Expand Down
27 changes: 1 addition & 26 deletions src/_details.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Module for internal structs that need to be publically accessible,
// Module for internal structs that need to be publicly accessible,
// but should not be directly used by consumers of the crate.
//
// Implementations for these structs are contained in other files.

use std::{marker::PhantomData, pin::Pin, sync::Arc};

use crate::native::ProviderTypes;

// Public with public fields because the `etw_event!` macro needs to create it at invocation site.
#[doc(hidden)]
Expand All @@ -14,26 +12,3 @@ pub struct EventMetadata {
pub identity: tracing::callsite::Identifier,
pub event_tag: u32,
}

// This struct needs to be public as it implements the tracing_subscriber::Layer trait.
#[doc(hidden)]
pub struct EtwLayer<S, Mode: ProviderTypes>
where
Mode::Provider: crate::native::EventWriter<Mode> + 'static
{
pub(crate) provider: Pin<Arc<Mode::Provider>>,
pub(crate) default_keyword: u64,
pub(crate) _p: PhantomData<S>,
}

// This struct needs to be public as it implements the tracing_subscriber::Layer::Filter trait.
#[doc(hidden)]
pub struct EtwFilter<S, Mode: ProviderTypes>
where
Mode::Provider: crate::native::EventWriter<Mode> + 'static
{
pub(crate) provider: Pin<Arc<Mode::Provider>>,
pub(crate) default_keyword: u64,
pub(crate) _p: PhantomData<S>,
pub(crate) _m: PhantomData<Mode>,
}
Loading

0 comments on commit e75ae5e

Please sign in to comment.