log with ordinal wip
This commit is contained in:
parent
e71351f135
commit
9296cc8c80
@ -187,12 +187,20 @@ pub enum LogMessage {
|
||||
}
|
||||
|
||||
impl LogMessage {
|
||||
pub fn to_log_localisation_config() -> BTreeMap<LogMessage,&'static str> {
|
||||
let mut data = BTreeMap::new();
|
||||
pub fn to_log_localisation_config() -> Vec<BTreeMap<&'static str, String>> {
|
||||
let mut array = Vec::with_capacity(LogMessage::len());
|
||||
|
||||
for msg_type in LogMessage::iter() {
|
||||
let s: &'static str = msg_type.clone().into();
|
||||
data.insert(msg_type, s);
|
||||
//todo this should be possible without copy?
|
||||
let name = msg_type.name().to_owned();
|
||||
let message: &'static str = msg_type.clone().into();
|
||||
|
||||
|
||||
let mut data = BTreeMap::new();
|
||||
data.insert("msg_type", name);
|
||||
data.insert("message", message.to_owned());
|
||||
array[msg_type.ordinal()] = data;
|
||||
}
|
||||
data
|
||||
array
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user