@@ -200,53 +200,53 @@ pub trait TypeId {
200200/// A log level matching the one from `log` crate.
201201///
202202/// Used internally by `sp_io::logging::log` method.
203- #[ derive( Encode , Decode , Copy , Clone ) ]
204- pub enum LogLevel {
203+ #[ derive( Copy , Clone ) ]
204+ pub enum RuntimeInterfaceLogLevel {
205205 /// `Error` log level.
206- Error = 1_isize ,
206+ Error = 0_isize ,
207207 /// `Warn` log level.
208- Warn = 2_isize ,
208+ Warn = 1_isize ,
209209 /// `Info` log level.
210- Info = 3_isize ,
210+ Info = 2_isize ,
211211 /// `Debug` log level.
212- Debug = 4_isize ,
212+ Debug = 3_isize ,
213213 /// `Trace` log level.
214- Trace = 5_isize ,
214+ Trace = 4_isize ,
215215}
216216
217- impl TryFrom < u8 > for LogLevel {
217+ impl TryFrom < u8 > for RuntimeInterfaceLogLevel {
218218 type Error = ( ) ;
219219 fn try_from ( value : u8 ) -> Result < Self , ( ) > {
220220 match value {
221- 1 => Ok ( Self :: Error ) ,
222- 2 => Ok ( Self :: Warn ) ,
223- 3 => Ok ( Self :: Info ) ,
224- 4 => Ok ( Self :: Debug ) ,
225- 5 => Ok ( Self :: Trace ) ,
221+ 0 => Ok ( Self :: Error ) ,
222+ 1 => Ok ( Self :: Warn ) ,
223+ 2 => Ok ( Self :: Info ) ,
224+ 3 => Ok ( Self :: Debug ) ,
225+ 4 => Ok ( Self :: Trace ) ,
226226 _ => Err ( ( ) ) ,
227227 }
228228 }
229229}
230230
231- impl From < LogLevel > for u8 {
232- fn from ( value : LogLevel ) -> Self {
231+ impl From < RuntimeInterfaceLogLevel > for u8 {
232+ fn from ( value : RuntimeInterfaceLogLevel ) -> Self {
233233 value as Self
234234 }
235235}
236236
237- impl From < u32 > for LogLevel {
237+ impl From < u32 > for RuntimeInterfaceLogLevel {
238238 fn from ( val : u32 ) -> Self {
239239 match val {
240- x if x == LogLevel :: Warn as u32 => LogLevel :: Warn ,
241- x if x == LogLevel :: Info as u32 => LogLevel :: Info ,
242- x if x == LogLevel :: Debug as u32 => LogLevel :: Debug ,
243- x if x == LogLevel :: Trace as u32 => LogLevel :: Trace ,
244- _ => LogLevel :: Error ,
240+ x if x == RuntimeInterfaceLogLevel :: Warn as u32 => RuntimeInterfaceLogLevel :: Warn ,
241+ x if x == RuntimeInterfaceLogLevel :: Info as u32 => RuntimeInterfaceLogLevel :: Info ,
242+ x if x == RuntimeInterfaceLogLevel :: Debug as u32 => RuntimeInterfaceLogLevel :: Debug ,
243+ x if x == RuntimeInterfaceLogLevel :: Trace as u32 => RuntimeInterfaceLogLevel :: Trace ,
244+ _ => RuntimeInterfaceLogLevel :: Error ,
245245 }
246246 }
247247}
248248
249- impl From < log:: Level > for LogLevel {
249+ impl From < log:: Level > for RuntimeInterfaceLogLevel {
250250 fn from ( l : log:: Level ) -> Self {
251251 use log:: Level :: * ;
252252 match l {
@@ -259,9 +259,9 @@ impl From<log::Level> for LogLevel {
259259 }
260260}
261261
262- impl From < LogLevel > for log:: Level {
263- fn from ( l : LogLevel ) -> Self {
264- use self :: LogLevel :: * ;
262+ impl From < RuntimeInterfaceLogLevel > for log:: Level {
263+ fn from ( l : RuntimeInterfaceLogLevel ) -> Self {
264+ use self :: RuntimeInterfaceLogLevel :: * ;
265265 match l {
266266 Error => Self :: Error ,
267267 Warn => Self :: Warn ,
0 commit comments