This commit is contained in:
Robin Appelman 2024-07-25 22:36:36 +02:00
commit 58721666b8
10 changed files with 48 additions and 38 deletions

56
Cargo.lock generated
View file

@ -200,34 +200,6 @@ dependencies = [
"os_str_bytes", "os_str_bytes",
] ]
[[package]]
name = "cloud-log-analyser"
version = "0.1.0"
dependencies = [
"ahash",
"clap",
"cloud-log-analyser-data",
"hdrhistogram",
"itertools",
"log",
"main_error",
"ratatui",
"regex",
"serde",
"serde_json",
"thiserror",
"time",
"tinystr",
"zip",
]
[[package]]
name = "cloud-log-analyser-data"
version = "0.1.0"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "compact_str" name = "compact_str"
version = "0.7.1" version = "0.7.1"
@ -555,6 +527,34 @@ version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "logsmash"
version = "0.1.0"
dependencies = [
"ahash",
"clap",
"hdrhistogram",
"itertools",
"log",
"logsmash-data",
"main_error",
"ratatui",
"regex",
"serde",
"serde_json",
"thiserror",
"time",
"tinystr",
"zip",
]
[[package]]
name = "logsmash-data"
version = "0.1.0"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "lru" name = "lru"
version = "0.12.3" version = "0.12.3"

View file

@ -1,5 +1,5 @@
[package] [package]
name = "cloud-log-analyser" name = "logsmash"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
rust-version = "1.74.0" rust-version = "1.74.0"
@ -12,7 +12,7 @@ serde_json = "1.0.120"
regex = "1.10.5" regex = "1.10.5"
log = "0.4.22" log = "0.4.22"
clap = { version = "=4.1.3", features = ["derive"] } clap = { version = "=4.1.3", features = ["derive"] }
cloud-log-analyser-data = { version = "0.1.0", path = "./data" } logsmash-data = { version = "0.1.0", path = "./data" }
zip = "2.1.5" zip = "2.1.5"
itertools = "0.13.0" itertools = "0.13.0"
ratatui = "0.27.0" ratatui = "0.27.0"

View file

@ -1,4 +1,14 @@
# cloud-log-analyser # logsmash_data
Analysis tool for Nextcloud logs files
![Logsmash screenshot](./screenshots/screenshot.png)
## Usage
```bash
logsmash ./logfile.log
```
### Updating baked data ### Updating baked data

2
data/Cargo.lock generated
View file

@ -3,7 +3,7 @@
version = 3 version = 3
[[package]] [[package]]
name = "cloud-log-analyser-data" name = "logsmash-data"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"serde", "serde",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "cloud-log-analyser-data" name = "logsmash-data"
description = "static data for cloud-log-analyser" description = "static data for logsmash"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"

BIN
screenshots/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

View file

@ -1,7 +1,7 @@
use crate::logline::LogLine; use crate::logline::LogLine;
use crate::matcher::MatchResult; use crate::matcher::MatchResult;
use crate::timegraph::TimeGraph; use crate::timegraph::TimeGraph;
use cloud_log_analyser_data::StatementList; use logsmash_data::StatementList;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use time::OffsetDateTime; use time::OffsetDateTime;

View file

@ -1,5 +1,5 @@
use ahash::AHasher; use ahash::AHasher;
use cloud_log_analyser_data::LogLevel; use logsmash_data::LogLevel;
use serde::Deserialize; use serde::Deserialize;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use time::OffsetDateTime; use time::OffsetDateTime;

View file

@ -5,7 +5,7 @@ use crate::logline::LogLine;
use crate::matcher::{MatchResult, Matcher}; use crate::matcher::{MatchResult, Matcher};
use crate::ui::run_ui; use crate::ui::run_ui;
use clap::Parser; use clap::Parser;
use cloud_log_analyser_data::{get_statements, MAX_VERSION}; use logsmash_data::{get_statements, MAX_VERSION};
use main_error::MainResult; use main_error::MainResult;
use std::collections::HashMap; use std::collections::HashMap;
use std::iter::once; use std::iter::once;

View file

@ -1,6 +1,6 @@
use crate::logline::LogLine; use crate::logline::LogLine;
use cloud_log_analyser_data::{LogLevel, LoggingStatement, StatementList};
use itertools::Either; use itertools::Either;
use logsmash_data::{LogLevel, LoggingStatement, StatementList};
use regex::Regex; use regex::Regex;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
use std::iter::once; use std::iter::once;