MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / parse_log

Function parse_log

fendermint/vm/interpreter/src/fvm/custom_kernel.rs:132–144  ·  view source on GitHub ↗
(log: &str)

Source from the content-addressed store, hash-verified

130}
131
132fn parse_log(log: &str) -> Option<(String, String, i32, String)> {
133 let re = Regex::new(r"(?s)\[(.*?)\]<(.*?)::(\d+)> (.*)").unwrap();
134 if let Some(captures) = re.captures(log) {
135 let first_string = captures.get(1)?.as_str().to_string();
136 let second_string = captures.get(2)?.as_str().to_string();
137 let number: i32 = captures.get(3)?.as_str().parse().ok()?;
138 let fourth_string = captures.get(4)?.as_str().to_string();
139
140 Some((first_string, second_string, number, fourth_string))
141 } else {
142 None
143 }
144}

Callers 1

logMethod · 0.85

Calls 5

to_stringMethod · 0.80
as_strMethod · 0.80
okMethod · 0.80
parseMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected