freeswitch_types/log_level.rs
1//! Log level names the ESL `log` command accepts.
2
3wire_enum! {
4 /// Argument of the ESL `log` command, which sets the level of `LOG` events
5 /// the connection receives.
6 ///
7 /// Names and numbers are `LEVELS[]` / `switch_log_level_t`, read by
8 /// `switch_log_str2level`. The switch compares them case-insensitively and
9 /// also accepts the bare number; this enum speaks the canonical lowercase
10 /// form, and the numbered `DEBUG1`..`DEBUG10` levels, which have no name in
11 /// `LEVELS[]`, are not variants.
12 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
13 #[repr(i8)]
14 pub enum LogLevel {
15 Disable = -1 => "disable",
16 Console = 0 => "console",
17 Alert = 1 => "alert",
18 Crit = 2 => "crit",
19 Error = 3 => "err",
20 Warning = 4 => "warning",
21 Notice = 5 => "notice",
22 Info = 6 => "info",
23 Debug = 7 => "debug",
24 }
25 error ParseLogLevelError("log level");
26 numeric: from_number(i8);
27 tests: log_level_wire_tests;
28}