Tracing support (#3372)

* Tracing support

* Add console subscriber

* Add console subscriber
This commit is contained in:
Jai Agrawal
2025-03-09 13:01:24 -07:00
committed by GitHub
parent 9c5d817a8a
commit 5c8ed9a8ca
14 changed files with 306 additions and 52 deletions

View File

@@ -15,12 +15,12 @@ use crate::search::SearchConfig;
use crate::util::date::get_current_tenths_of_ms;
use crate::util::guards::admin_key_guard;
use actix_web::{get, patch, post, web, HttpRequest, HttpResponse};
use log::info;
use serde::Deserialize;
use sqlx::PgPool;
use std::collections::HashMap;
use std::net::Ipv4Addr;
use std::sync::Arc;
use tracing::info;
pub fn config(cfg: &mut web::ServiceConfig) {
cfg.service(

View File

@@ -17,7 +17,6 @@ use crate::routes::ApiError;
use actix_web::{delete, get, patch, post, web, HttpRequest, HttpResponse};
use ariadne::ids::base62_impl::{parse_base62, to_base62};
use chrono::Utc;
use log::{info, warn};
use rust_decimal::prelude::ToPrimitive;
use rust_decimal::Decimal;
use serde::Serialize;
@@ -34,6 +33,7 @@ use stripe::{
PaymentIntentSetupFutureUsage, PaymentMethodId, SetupIntent,
UpdateCustomer, Webhook,
};
use tracing::{info, warn};
pub fn config(cfg: &mut web::ServiceConfig) {
cfg.service(

View File

@@ -114,7 +114,7 @@ pub async fn ws_init(
.insert(socket_id);
#[cfg(debug_assertions)]
log::info!("Connection {socket_id} opened by {}", user.id);
tracing::info!("Connection {socket_id} opened by {}", user.id);
broadcast_friends(
user.id,
@@ -161,7 +161,10 @@ pub async fn ws_init(
#[cfg(debug_assertions)]
if !message.is_binary() {
log::info!("Received message from {socket_id}: {:?}", message);
tracing::info!(
"Received message from {socket_id}: {:?}",
message
);
}
match message {

View File

@@ -31,11 +31,11 @@ use actix_web::{web, HttpRequest, HttpResponse};
use chrono::Utc;
use futures::stream::StreamExt;
use itertools::Itertools;
use log::error;
use serde::{Deserialize, Serialize};
use sqlx::postgres::PgPool;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
use tracing::error;
use validator::Validate;
fn default_requested_status() -> VersionStatus {