Skip to main content

chdb_rust/
log_level.rs

1//! Log level definitions for chDB.
2//!
3//! This module defines the log levels that can be used to configure chDB's logging behavior.
4
5/// Log levels for chDB.
6///
7/// These correspond to the standard log levels used by chDB for controlling
8/// the verbosity of log output.
9#[derive(Debug, Clone, Copy)]
10pub enum LogLevel {
11    Trace,
12    Debug,
13    Info,
14    Warn,
15    Error,
16}
17
18impl LogLevel {
19    /// Get the string representation of the log level.
20    ///
21    /// This returns the log level name as expected by chDB.
22    ///
23    /// # Returns
24    ///
25    /// Returns the log level name as a static string slice.
26    pub const fn as_str(self) -> &'static str {
27        match self {
28            Self::Trace => "trace",
29            Self::Debug => "debug",
30            Self::Info => "information",
31            Self::Warn => "warning",
32            Self::Error => "error",
33        }
34    }
35}