pub enum PostfixLogLevel {
Debug,
Info,
Warning,
Error,
Fatal,
Panic,
}
Expand description
Postfix日志等级,对应Postfix源码中的msg_*函数 基于Postfix源码:msg_debug, msg_info, msg_warn, msg_error, msg_fatal, msg_panic
Variants§
Debug
msg_debug() - 调试信息(默认关闭)
Info
msg_info() - 正常业务操作(最常见,默认等级)
Warning
msg_warn() - 警告,可恢复问题
Error
msg_error() - 错误,操作失败但系统可继续
Fatal
msg_fatal() - 致命错误,导致进程退出
Panic
msg_panic() - 系统崩溃级别
Implementations§
Source§impl PostfixLogLevel
impl PostfixLogLevel
Sourcepub fn severity_level(&self) -> u8
pub fn severity_level(&self) -> u8
获取日志等级的严重程度数值(1-6,数值越高越严重)
Sourcepub fn is_error_level(&self) -> bool
pub fn is_error_level(&self) -> bool
检查是否为错误级别(Error/Fatal/Panic)
Sourcepub fn is_warning_level(&self) -> bool
pub fn is_warning_level(&self) -> bool
检查是否为警告级别
Sourcepub fn is_debug_level(&self) -> bool
pub fn is_debug_level(&self) -> bool
检查是否为调试级别
Sourcepub fn from_prefix(prefix: &str) -> Option<Self>
pub fn from_prefix(prefix: &str) -> Option<Self>
从字符串解析日志等级(用于解析日志中的等级前缀)
Trait Implementations§
Source§impl Clone for PostfixLogLevel
impl Clone for PostfixLogLevel
Source§fn clone(&self) -> PostfixLogLevel
fn clone(&self) -> PostfixLogLevel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PostfixLogLevel
impl Debug for PostfixLogLevel
Source§impl<'de> Deserialize<'de> for PostfixLogLevel
impl<'de> Deserialize<'de> for PostfixLogLevel
Source§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
Source§impl Display for PostfixLogLevel
impl Display for PostfixLogLevel
Source§impl Hash for PostfixLogLevel
impl Hash for PostfixLogLevel
Source§impl PartialEq for PostfixLogLevel
impl PartialEq for PostfixLogLevel
Source§impl Serialize for PostfixLogLevel
impl Serialize for PostfixLogLevel
impl Eq for PostfixLogLevel
impl StructuralPartialEq for PostfixLogLevel
Auto Trait Implementations§
impl Freeze for PostfixLogLevel
impl RefUnwindSafe for PostfixLogLevel
impl Send for PostfixLogLevel
impl Sync for PostfixLogLevel
impl Unpin for PostfixLogLevel
impl UnwindSafe for PostfixLogLevel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more