add markdown log format for capture
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
c914a4fd91
commit
1f9225e4d1
6 changed files with 95 additions and 17 deletions
|
@ -648,16 +648,18 @@ pub(crate) async fn resolve_true_destination(
|
|||
|
||||
let state = &services().server.log.capture;
|
||||
let logs = Arc::new(Mutex::new(String::new()));
|
||||
let capture = Capture::new(state, Some(filter), capture::to_html(&logs));
|
||||
let capture = Capture::new(state, Some(filter), capture::fmt_markdown(logs.clone()));
|
||||
let (actual_dest, hostname_uri);
|
||||
{
|
||||
let _capture_scope = capture.start();
|
||||
(actual_dest, hostname_uri) = resolve_actual_dest(&server_name, !no_cache).await?;
|
||||
};
|
||||
|
||||
let plain = format!("Actual destination: {actual_dest} | Hostname URI: {hostname_uri}");
|
||||
let html = format!("{}<br>{plain}", logs.lock().expect("locked"));
|
||||
Ok(RoomMessageEventContent::text_html(plain, html))
|
||||
let msg = format!(
|
||||
"{}\nDestination: {actual_dest}\nHostname URI: {hostname_uri}",
|
||||
logs.lock().expect("locked")
|
||||
);
|
||||
Ok(RoomMessageEventContent::text_markdown(msg))
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue