Replace logging function with a macro

This commit is contained in:
Juno Takano 2025-12-18 02:19:55 -03:00
commit 0d66b1ee7c
5 changed files with 44 additions and 44 deletions

View file

@ -3,6 +3,7 @@ use axum::{
http::{Response, StatusCode, header, HeaderValue},
};
use crate::prelude::*;
use crate::{
formats::{Format, populate_graph, serialize_graph},
};
@ -24,22 +25,12 @@ pub async fn file(file_path: &str, content_type: &str) -> Response<Body> {
if let Ok(header_value) = HeaderValue::from_str(content_type) {
if let Some(h) = response.headers_mut().insert(header, header_value) {
crate::dev::log(
&file,
&format!(
"Overwrote existing header {h:?} because a header for \
the same key existed"
),
log!(
"Overwrote existing header {h:?} because a header for the same key existed"
);
}
} else {
crate::dev::log(
&file,
&format!(
"Failed to create content type \
header value from {content_type}"
),
);
log!("Failed to create content type header value from {content_type}");
}
response