From 2c1fc095760b07171973c4a7540820c5e3013c0d Mon Sep 17 00:00:00 2001 From: Baud Date: Sat, 1 Jun 2024 16:01:20 +0100 Subject: [PATCH] More debugging --- index.ts | 16 ++++++++++++++-- src/main.rs | 5 +++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index bcecfe5..27dab80 100644 --- a/index.ts +++ b/index.ts @@ -91,7 +91,11 @@ function handle_message(message: Partial) { status: transportInfo.status, }) }).catch((err) => { - console.log(err) + console.log(JSON.stringify(err)) + notifyClients({ + event: "log", + message: JSON.stringify(err) + }) }) }, 1000) @@ -107,7 +111,11 @@ function handle_message(message: Partial) { remaining: slot.recordingTime }) }).catch((err) => { - console.log(err) + console.log(JSON.stringify(err)) + notifyClients({ + event: "log", + message: JSON.stringify(err) + }) }) }, 1000) } @@ -132,6 +140,10 @@ function handle_message(message: Partial) { }) newHyperdeck.on('error', (err) => { console.log('Hyperdeck error', JSON.stringify(err)) + notifyClients({ + event: "log", + message: JSON.stringify(err) + }) }) newHyperdeck.on('disconnected', () => { diff --git a/src/main.rs b/src/main.rs index d546242..bc804c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,6 +102,7 @@ async fn handle_message_from_node( _node_commands_tx: &mut tokio::sync::mpsc::UnboundedSender, state: &mut HyperdeckMonitorState, ) -> bool { + tracing::info!("{:?}", msg); match msg { NodeWsMessageReceived::Log { message } => { tracing::info!("[NODE] {message}"); @@ -253,7 +254,7 @@ enum NodeWsCommand { RemoveHyperdeck(RemoveHyperdeckCommand), } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] #[serde(tag = "event")] enum NodeWsMessageReceived { @@ -277,7 +278,7 @@ enum NodeWsMessageReceived { }, } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] enum TransportStatus { Preview,