mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
enable rust logs
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1426,6 +1426,7 @@ dependencies = [
|
|||||||
"tokio-tar",
|
"tokio-tar",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"toml",
|
"toml",
|
||||||
|
"tracing-subscriber",
|
||||||
"url",
|
"url",
|
||||||
"uuid",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ tokio-util = "0.7.9"
|
|||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
url = "2"
|
url = "2"
|
||||||
uuid = { version = "1", features = ["serde", "v4"] }
|
uuid = { version = "1", features = ["serde", "v4"] }
|
||||||
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
|
|
||||||
# Pin OpenSSL to 3.1 releases.
|
# Pin OpenSSL to 3.1 releases.
|
||||||
# OpenSSL 3.2 has a regression tracked at <https://github.com/openssl/openssl/issues/23376>
|
# OpenSSL 3.2 has a regression tracked at <https://github.com/openssl/openssl/issues/23376>
|
||||||
@@ -113,6 +114,7 @@ uuid = { version = "1", features = ["serde", "v4"] }
|
|||||||
# 3.1 branch will be supported until 2025-03-14.
|
# 3.1 branch will be supported until 2025-03-14.
|
||||||
openssl-src = "~300.1"
|
openssl-src = "~300.1"
|
||||||
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ansi_term = "0.12.0"
|
ansi_term = "0.12.0"
|
||||||
anyhow = { version = "1", features = ["backtrace"] } # Enable `backtrace` feature in tests.
|
anyhow = { version = "1", features = ["backtrace"] } # Enable `backtrace` feature in tests.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use async_channel::{self as channel, Receiver, Sender};
|
|||||||
use pgp::SignedPublicKey;
|
use pgp::SignedPublicKey;
|
||||||
use ratelimit::Ratelimit;
|
use ratelimit::Ratelimit;
|
||||||
use tokio::sync::{Mutex, Notify, OnceCell, RwLock};
|
use tokio::sync::{Mutex, Notify, OnceCell, RwLock};
|
||||||
|
use tracing_subscriber::{prelude::*, EnvFilter};
|
||||||
|
|
||||||
use crate::aheader::EncryptPreference;
|
use crate::aheader::EncryptPreference;
|
||||||
use crate::chat::{get_chat_cnt, ChatId, ProtectionStatus};
|
use crate::chat::{get_chat_cnt, ChatId, ProtectionStatus};
|
||||||
@@ -337,6 +338,13 @@ impl Context {
|
|||||||
events: Events,
|
events: Events,
|
||||||
stock_strings: StockStrings,
|
stock_strings: StockStrings,
|
||||||
) -> Result<Context> {
|
) -> Result<Context> {
|
||||||
|
// set the RUST_LOG env var to one of {debug,info,warn} to see logging info
|
||||||
|
tracing_subscriber::registry()
|
||||||
|
.with(tracing_subscriber::fmt::layer().with_writer(std::io::stderr))
|
||||||
|
.with(EnvFilter::from_default_env())
|
||||||
|
.try_init()
|
||||||
|
.ok();
|
||||||
|
|
||||||
let context =
|
let context =
|
||||||
Self::new_closed(dbfile, id, events, stock_strings, Default::default()).await?;
|
Self::new_closed(dbfile, id, events, stock_strings, Default::default()).await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user