vitess_grpc/generated/
logutil.rs

1/// Event is a single logging event
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Event {
5    #[prost(message, optional, tag = "1")]
6    pub time: ::core::option::Option<super::vttime::Time>,
7    #[prost(enumeration = "Level", tag = "2")]
8    pub level: i32,
9    #[prost(string, tag = "3")]
10    pub file: ::prost::alloc::string::String,
11    #[prost(int64, tag = "4")]
12    pub line: i64,
13    #[prost(string, tag = "5")]
14    pub value: ::prost::alloc::string::String,
15}
16/// Level is the level of the log messages.
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
18#[repr(i32)]
19pub enum Level {
20    /// The usual logging levels.
21    /// Should be logged using logging facility.
22    Info = 0,
23    Warning = 1,
24    Error = 2,
25    /// For messages that may contains non-logging events.
26    /// Should be logged to console directly.
27    Console = 3,
28}
29impl Level {
30    /// String value of the enum field names used in the ProtoBuf definition.
31    ///
32    /// The values are not transformed in any way and thus are considered stable
33    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
34    pub fn as_str_name(&self) -> &'static str {
35        match self {
36            Level::Info => "INFO",
37            Level::Warning => "WARNING",
38            Level::Error => "ERROR",
39            Level::Console => "CONSOLE",
40        }
41    }
42    /// Creates an enum from field names used in the ProtoBuf definition.
43    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
44        match value {
45            "INFO" => Some(Self::Info),
46            "WARNING" => Some(Self::Warning),
47            "ERROR" => Some(Self::Error),
48            "CONSOLE" => Some(Self::Console),
49            _ => None,
50        }
51    }
52}