Skip to content

Commit 880c06f

Browse files
Add some logging, set dev logging level to debug
This is leftover from the unsuccessful/incomplete debugging of #136
1 parent 22951d6 commit 880c06f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# latest watchexec we can get rid of this.
77
# https://github.com/watchexec/cargo-watch/issues/269
88

9-
RUST_LOG=${RUST_LOG:-slumber=trace} watchexec --restart --no-process-group \
9+
RUST_LOG=${RUST_LOG:-slumber=debug} watchexec --restart --no-process-group \
1010
--watch Cargo.toml --watch Cargo.lock --watch src/ \
1111
-- cargo run \
1212
-- $@

src/tui.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use std::{
3737
time::{Duration, Instant},
3838
};
3939
use tokio::sync::mpsc::{self, UnboundedReceiver};
40-
use tracing::{debug, error};
40+
use tracing::{debug, error, info, trace};
4141

4242
/// Main controller struct for the TUI. The app uses a React-like architecture
4343
/// for the view, with a wrapping controller (this struct). The main loop goes
@@ -161,6 +161,7 @@ impl Tui {
161161

162162
// ===== Message Phase =====
163163
while let Ok(message) = self.messages_rx.try_recv() {
164+
trace!(?message, "Handling message");
164165
// If an error occurs, store it so we can show the user
165166
if let Err(error) = self.handle_message(message) {
166167
self.view.open_modal(error, ModalPriority::High);
@@ -181,6 +182,7 @@ impl Tui {
181182

182183
/// GOODBYE
183184
fn quit(&mut self) {
185+
info!("Initiating graceful shutdown");
184186
self.should_run = false;
185187
}
186188

@@ -305,6 +307,10 @@ impl Tui {
305307
})?;
306308
watcher
307309
.watch(self.collection_file.path(), RecursiveMode::NonRecursive)?;
310+
info!(
311+
path = ?self.collection_file.path(), ?watcher,
312+
"Watching collection file for changes"
313+
);
308314
Ok(watcher)
309315
}
310316

0 commit comments

Comments
 (0)