Enum nakadion::consumer::complex_types::LogPartitionEventsMode [−][src]
#[non_exhaustive]
pub enum LogPartitionEventsMode {
Off,
AfterConnect,
ActivityChange,
All,
}
Expand description
Configures the logging for partition events.
A partition event occurs if a new partition is discovered for the
first time on a stream (AfterConnect
) or if it was deactivated or reactivated
(ActivityChange
) caused by PartitionInactivityTimeoutSecs
.
The default is LogPartitionEventsMode::All
.
Disabled log messages will still be logged at DEBUG level.
FromStr
use nakadion::consumer::LogPartitionEventsMode;
let strategy = "off".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::Off);
let strategy = "after_connect".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::AfterConnect);
let strategy = "activity_change".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::ActivityChange);
let strategy = "all".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::All);
JSON is also valid:
use nakadion::consumer::LogPartitionEventsMode;
let strategy = "\"off\"".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::Off);
let strategy = "\"after_connect\"".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::AfterConnect);
let strategy = "\"activity_change\"".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::ActivityChange);
let strategy = "\"all\"".parse::<LogPartitionEventsMode>().unwrap();
assert_eq!(strategy, LogPartitionEventsMode::All);
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Do not log
Log partitions only when encountered the first time after a stream connect
Log partitions only when inactivated or reactivated
Log all
Implementations
The default name of the environment variable for this type. The name of the environment variable is “ LOG_PARTITION_EVENTS_MODE “
Initialize from the environment.
Returns None
if the value was not found and fails if the value could not be parsed.
The name of the environment variable is “NAKADION_
LOG_PARTITION_EVENTS_MODE
“
Initialize from the environment.
Returns None
if the value was not found and fails if the value could not be parsed.
The name of the environment variable is “prefix
_
LOG_PARTITION_EVENTS_MODE
“
The underscore and prefix will be omitted if prefix is empty.
Initialize from the environment.
Returns None
if the value was not found and fails if the value could not be parsed.
The name of the environment variable is var_name
.
Initialize from the environment.
Returns None
if the value was not found and fails if the value could not be parsed.
The name of the environment variable is “
LOG_PARTITION_EVENTS_MODE
“
Initialize from the environment. Fails if the value was not found or if the value could not be parsed. The name of the environment variable is “NAKADION_ LOG_PARTITION_EVENTS_MODE “
Initialize from the environment.
Fails if the value was not found or if the value could not be parsed.
The name of the environment variable is “prefix
_
LOG_PARTITION_EVENTS_MODE
“
The underscore and prefix will be omitted if prefix is empty.
Initialize from the environment.
Fails if the value was not found or if the value could not be parsed.
The name of the environment variable is var_name
.
Initialize from the environment. Fails if the value was not found or if the value could not be parsed. The name of the environment variable is “ LOG_PARTITION_EVENTS_MODE “
Initialize from the environment.
Returns None
if the value could not be read for any reason.
The name of the environment variable is “NAKADION_
LOG_PARTITION_EVENTS_MODE
“
Initialize from the environment.
Returns None
if the value could not be read for any reason.
The name of the environment variable is “prefix
_
LOG_PARTITION_EVENTS_MODE
“
The underscore and prefix will be omitted if prefix is empty.
Initialize from the environment.
Returns None
if the value could not be read for any reason.
The name of the environment variable is var_name
.
Initialize from the environment.
Returns None
if the value could not be read for any reason.
The name of the environment variable is “
LOG_PARTITION_EVENTS_MODE
“
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for LogPartitionEventsMode
impl Send for LogPartitionEventsMode
impl Sync for LogPartitionEventsMode
impl Unpin for LogPartitionEventsMode
impl UnwindSafe for LogPartitionEventsMode
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more