mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 18:14:11 +02:00
initial log extraction logic
This commit is contained in:
commit
572582517c
18 changed files with 2827 additions and 0 deletions
12
logging-extractor/tests/snapshot.rs
Normal file
12
logging-extractor/tests/snapshot.rs
Normal 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)
|
||||
}
|
||||
|
|
@ -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: ",
|
||||
", "
|
||||
]
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue