diff --git a/vosk/src/log.rs b/vosk/src/log.rs index af28673..cfe7c00 100644 --- a/vosk/src/log.rs +++ b/vosk/src/log.rs @@ -4,12 +4,12 @@ use vosk_sys::*; #[derive(Debug, Default, Clone, Copy)] /// Log level for Kaldi messages. pub enum LogLevel { - /// Print Error, Info and Debug messages. - ErrorInfoDebug, - - /// Print Error and Info, but not Debug messages (default). + /// Print Error, Warn, and Info (default) #[default] - ErrorInfo, + Info, + + /// Print Error and Warn messages. + Warn, /// Only print Error messages. Error, @@ -18,16 +18,16 @@ pub enum LogLevel { impl LogLevel { pub(self) fn to_c_int(self) -> c_int { match self { - Self::ErrorInfo => 0, - Self::Error => -1, - Self::ErrorInfoDebug => 1, + Self::Info => 0, + Self::Warn => -1, + Self::Error => -2, } } } /// Set log level for Kaldi messages. /// -/// Default: [`LogLevel::ErrorInfo`]. +/// Default: [`LogLevel::Info`]. pub fn set_log_level(log_level: LogLevel) { unsafe { vosk_set_log_level(log_level.to_c_int()) } }