LogLevel From/Into u8
@@ -77,6 +77,18 @@ impl FromStr for LogLevel {
}
}
+impl From<u8> for LogLevel {
+ fn from(val: u8) -> Self {
+ Self::from_verbosity_flag_count(val)
+ }
+}
+
+impl From<LogLevel> for u8 {
+ fn from(log_level: LogLevel) -> Self {
+ log_level.verbosity_flag_count()
+ }
+}
+
impl LogLevel {
/// Indicates number of required verbosity flags
pub fn verbosity_flag_count(&self) -> u8 {
