File tree Expand file tree Collapse file tree 4 files changed +26
-5
lines changed
Expand file tree Collapse file tree 4 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,11 @@ impl Accounts {
377377 "Starting background fetch for {n_accounts} accounts."
378378 ) ) ,
379379 } ) ;
380+ :: tracing:: event!(
381+ :: tracing:: Level :: INFO ,
382+ account_id = 0 ,
383+ "Starting background fetch for {n_accounts} accounts."
384+ ) ;
380385 let mut set = JoinSet :: new ( ) ;
381386 for account in accounts {
382387 set. spawn ( async move {
@@ -392,6 +397,11 @@ impl Accounts {
392397 "Finished background fetch for {n_accounts} accounts."
393398 ) ) ,
394399 } ) ;
400+ :: tracing:: event!(
401+ :: tracing:: Level :: INFO ,
402+ account_id = 0 ,
403+ "Finished background fetch for {n_accounts} accounts."
404+ ) ;
395405 }
396406
397407 /// Auxiliary function for [Accounts::background_fetch].
@@ -429,6 +439,11 @@ impl Accounts {
429439 id : 0 ,
430440 typ : EventType :: Warning ( "Background fetch timed out." . to_string ( ) ) ,
431441 } ) ;
442+ :: tracing:: event!(
443+ :: tracing:: Level :: WARN ,
444+ account_id = 0 ,
445+ "Background fetch timed out."
446+ ) ;
432447 }
433448 events. emit ( Event {
434449 id : 0 ,
Original file line number Diff line number Diff line change @@ -30,9 +30,10 @@ pub(crate) async fn emit_chatlist_item_changed_for_contact_chat(
3030 match ChatId :: lookup_by_contact ( context, contact_id) . await {
3131 Ok ( Some ( chat_id) ) => self :: emit_chatlist_item_changed ( context, chat_id) ,
3232 Ok ( None ) => { }
33- Err ( error) => context. emit_event ( EventType :: Error ( format ! (
33+ Err ( error) => error ! (
34+ context,
3435 "failed to find chat id for contact for chatlist event: {error:?}"
35- ) ) ) ,
36+ ) ,
3637 }
3738}
3839
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ impl<S: SessionStream> AsyncRead for LoggingStream<S> {
9292 "Read error on stream {peer_addr:?} after reading {} and writing {} bytes: {err}." ,
9393 this. metrics. total_read, this. metrics. total_written
9494 ) ;
95+ tracing:: event!(
96+ :: tracing:: Level :: WARN ,
97+ account_id = * this. account_id,
98+ log_message
99+ ) ;
95100 this. events . emit ( Event {
96101 id : * this. account_id ,
97102 typ : EventType :: Warning ( log_message) ,
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ use serde::Deserialize;
1616use crate :: config:: Config ;
1717use crate :: contact:: { Contact , ContactId , Origin } ;
1818use crate :: context:: Context ;
19- use crate :: events:: EventType ;
2019use crate :: key:: Fingerprint ;
2120use crate :: login_param:: { EnteredCertificateChecks , EnteredLoginParam , EnteredServerLoginParam } ;
2221use crate :: net:: http:: post_empty;
@@ -824,9 +823,10 @@ pub(crate) async fn login_param_from_account_qr(
824823 match serde_json:: from_str :: < CreateAccountErrorResponse > ( & response_text) {
825824 Ok ( error) => Err ( anyhow ! ( error. reason) ) ,
826825 Err ( parse_error) => {
827- context. emit_event ( EventType :: Error ( format ! (
826+ error ! (
827+ context,
828828 "Cannot create account, server response could not be parsed:\n {parse_error:#}\n raw response:\n {response_text}"
829- ) ) ) ;
829+ ) ;
830830 bail ! ( "Cannot create account, unexpected server response:\n {response_text:?}" )
831831 }
832832 }
You can’t perform that action at this time.
0 commit comments