initial log extraction logic

This commit is contained in:
Robin Appelman 2024-07-20 16:13:58 +02:00
commit 572582517c
18 changed files with 2827 additions and 0 deletions

View file

@ -0,0 +1,12 @@
use logging_extractor::{extract_dir, LoggingStatement};
use test_case::test_case;
#[test_case("DefaultShareProvider")]
fn snapshot_test(name: &str) {
let root = format!("test-data/{name}");
let mut output = Vec::<u8>::with_capacity(1024 * 1024);
extract_dir(&root, &mut output).unwrap();
let output: Vec<LoggingStatement> = serde_json::from_slice(&output).unwrap();
insta::assert_json_snapshot!(output)
}

View file

@ -0,0 +1,57 @@
---
source: tests/snapshot.rs
expression: output
---
[
{
"level": "error",
"path": "/DefaultShareProvider.php",
"line": 1171,
"message_parts": []
},
{
"level": "debug",
"path": "/DefaultShareProvider.php",
"line": 1392,
"message_parts": [
"Share notification not sent to ",
" because user could not be found."
]
},
{
"level": "debug",
"path": "/DefaultShareProvider.php",
"line": 1401,
"message_parts": [
"Share notification not sent to ",
" because email address is not set."
]
},
{
"level": "debug",
"path": "/DefaultShareProvider.php",
"line": 1416,
"message_parts": [
"Sent share notification to ",
" for share with ID ",
"."
]
},
{
"level": "error",
"path": "/DefaultShareProvider.php",
"line": 1420,
"message_parts": [
"Share notification mail could not be sent."
]
},
{
"level": "error",
"path": "/DefaultShareProvider.php",
"line": 1507,
"message_parts": [
"Share notification mail could not be sent to: ",
", "
]
}
]