1use serde::Serialize;
2use sqlx::FromRow;
3
4#[derive(Clone, Debug, Serialize)]
5pub struct LogEntry {
6 pub ts: i64,
7 pub ts_nanos: i64,
8 pub level: String,
9 pub target: String,
10 pub message: Option<String>,
11 pub feedback_log_body: Option<String>,
12 pub thread_id: Option<String>,
13 pub process_uuid: Option<String>,
14 pub module_path: Option<String>,
15 pub file: Option<String>,
16 pub line: Option<i64>,
17}
18
19#[derive(Clone, Debug, FromRow)]
20pub struct LogRow {
21 pub id: i64,
22 pub ts: i64,
23 pub ts_nanos: i64,
24 pub level: String,
25 pub target: String,
26 pub message: Option<String>,
27 pub thread_id: Option<String>,
28 pub process_uuid: Option<String>,
29 pub file: Option<String>,
30 pub line: Option<i64>,
31}
32
33#[derive(Clone, Debug, Default)]
34pub struct LogQuery {
35 pub levels_upper: Vec<String>,
36 pub from_ts: Option<i64>,
37 pub to_ts: Option<i64>,
38 pub module_like: Vec<String>,
39 pub file_like: Vec<String>,
40 pub thread_ids: Vec<String>,
41 pub search: Option<String>,
42 pub include_threadless: bool,
43 pub after_id: Option<i64>,
44 pub limit: Option<usize>,
45 pub descending: bool,
46}