Skip to content

Commit a2c35ff

Browse files
committed
[rust] Include field for error message in the minimal JSON
1 parent 40ab340 commit a2c35ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rust/src/logger.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub struct JsonOutput {
7575
pub struct MinimalJson {
7676
pub driver_path: String,
7777
pub browser_path: String,
78+
pub message: String,
7879
}
7980

8081
impl Logger {
@@ -211,13 +212,16 @@ impl Logger {
211212
}
212213
}
213214
_ => {
214-
if self.output == OutputType::Mixed && level == Level::Info {
215+
if self.output == OutputType::Mixed && level == Level::Info || level <= Level::Error
216+
{
215217
if message.starts_with(DRIVER_PATH) {
216218
self.minimal_json.borrow_mut().driver_path =
217219
self.clean_driver_path(&message);
218220
} else if message.starts_with(BROWSER_PATH) {
219221
self.minimal_json.borrow_mut().browser_path =
220222
self.clean_browser_path(&message);
223+
} else {
224+
self.minimal_json.borrow_mut().message = message.clone();
221225
}
222226
}
223227
log::log!(level, "{}", message);

0 commit comments

Comments
 (0)