Skip to content

Commit 090e0ac

Browse files
committed
feat: logging (#14)
1 parent 3b453e3 commit 090e0ac

37 files changed

Lines changed: 317 additions & 50 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target/
2+
/*log.txt

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "lldb",
66
"request": "launch",
77
"name": "Debug",
8-
"program": "${workspaceFolder}/target/debug/wiretui-bin",
8+
"program": "${workspaceFolder}/target/debug/wiretui",
99
"preLaunchTask": "build:wiretui",
1010
"console": "externalTerminal"
1111
}

Cargo.lock

Lines changed: 181 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
[workspace]
22
resolver = "3"
3-
members = ["src-libs/*", "src-bin/*"]
3+
members = ["crates/*"]
44

55
[workspace.package]
66
version = "0.0.0"
77
authors = ["robin-thoene"]
88
license = "MIT"
9+
10+
[workspace.dependencies]
11+
env_logger = "0.11.8"
12+
log = "0.4.28"
13+
crossterm = "0.29.0"
14+
ratatui = "0.29.0"
15+
zbus = "5.12.0"
16+
serde = "1.0.228"

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,23 @@ cargo deny check
4545

4646
This project contains a debugger configuration using [.vscode files](./.vscode/). Those can be
4747
used in Neovim as well (see example [here](https://github.com/robin-thoene/dotfiles/blob/f388381f49d4b79e2755e18929d2462d198bd30d/.config/nvim/lua/plugins/nvim_dap.lua#L98)).
48+
49+
## Logging
50+
51+
This application uses the **log** crate in combination with the **env_logger** crate to set the
52+
log level. By default the logs are written to a file, which is overridden every time you run the
53+
application.
54+
55+
You can see it's current content with
56+
57+
```shell
58+
cat ~/.local/state/wiretui/log.txt
59+
```
60+
61+
To override the log level when running the application use
62+
63+
```shell
64+
RUST_LOG=debug cargo run
65+
```
66+
67+
Valid log level are `trace`, `debug`, `info`, `warn` and `error`.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ license.workspace = true
1111
application = { path = "../application" }
1212
domain = { path = "../domain" }
1313
ports = { path = "../ports" }
14-
crossterm = "0.29.0"
15-
ratatui = "0.29.0"
16-
zbus = "5.12.0"
17-
serde = "1.0.228"
14+
crossterm = { workspace = true }
15+
ratatui = { workspace = true }
16+
zbus = { workspace = true }
17+
serde = { workspace = true }
18+
log = { workspace = true }
File renamed without changes.

src-libs/adapters/src/inbound/tui/custom_widgets/connection_list.rs renamed to crates/adapters/src/inbound/tui/custom_widgets/connection_list.rs

File renamed without changes.

0 commit comments

Comments
 (0)