fix: use diagnostic instead of compilermessage giving rendered ansi logs during hotpatch (#4123)

* fix: use diagnostic instead of compilermessage giving rendered ansi logs during hotpatch

* no need for builder
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-05-19 17:10:11 +02:00
1 parent 0a18c12c32
commit b610ab372c
6 files changed
+24 -14

No files matched your search

+4 -3
View File
@@ -2,6 +2,7 @@ use crate::{
serve::{ansi_buffer::AnsiStringLine, ServeUpdate, WebServer},
BuildStage, BuilderUpdate, Platform, TraceContent, TraceMsg, TraceSrc,
};
use cargo_metadata::diagnostic::Diagnostic;
use crossterm::{
cursor::{Hide, Show},
event::{
@@ -294,10 +295,10 @@ impl Output {
self.pending_logs.push_front(message);
}
pub fn push_cargo_log(&mut self, message: cargo_metadata::CompilerMessage) {
pub fn push_cargo_log(&mut self, message: Diagnostic) {
use cargo_metadata::diagnostic::DiagnosticLevel;
if self.trace || !matches!(message.message.level, DiagnosticLevel::Note) {
if self.trace || !matches!(message.level, DiagnosticLevel::Note) {
self.push_log(TraceMsg::cargo(message));
}
}
@@ -924,7 +925,7 @@ impl Output {
use chrono::Timelike;
let rendered = match log.content {
TraceContent::Cargo(msg) => msg.message.rendered.unwrap_or_default(),
TraceContent::Cargo(msg) => msg.rendered.unwrap_or_default(),
TraceContent::Text(text) => text,
};