change: Custom Debug impl for TaskLogMessage
@@ -256,7 +256,7 @@ pub struct LogRequestMessage {
}
/// Helper struct for sending tasks and their log output to the client.
-#[derive(PartialEq, Eq, Clone, Debug, Deserialize, Serialize)]
+#[derive(PartialEq, Eq, Clone, Deserialize, Serialize)]
pub struct TaskLogMessage {
pub task: Task,
#[serde(default = "bool::default")]
@@ -265,6 +265,18 @@ pub struct TaskLogMessage {
pub output: Option<Vec<u8>>,
}
+/// We use a custom `Debug` implementation for [TaskLogMessage], as the `output` field
+/// has too much info in it and renders log output unreadable.
+impl std::fmt::Debug for TaskLogMessage {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("TaskLogMessage")
+ .field("task", &self.task)
+ .field("output_complete", &self.output_complete)
+ .field("output", &"hidden")
+ .finish()
+ }
+}
+
#[derive(PartialEq, Eq, Clone, Debug, Deserialize, Serialize)]
pub struct ParallelMessage {
pub parallel_tasks: usize,
