Skip to content

Commit

Permalink
Change references of env_logger to tracing-subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbt365 committed Nov 24, 2024
1 parent 22b5b01 commit f5c303a
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 53 deletions.
144 changes: 97 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ version = "0.12.4"
# For the examples
tokio = { version = "1.25.1", features = ["rt-multi-thread"] }
futures = { version = "0.3.13", default-features = false }
env_logger = "0.10.1"
tracing-subscriber = "0.3.18"
fluent = "0.16.0"
intl-memoizer = "0.5.1"
fluent-syntax = "0.11"
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_structure/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async fn on_error(error: poise::FrameworkError<'_, Data, Error>) {

#[tokio::main]
async fn main() {
env_logger::init();
tracing_subscriber::fmt::init();

// FrameworkOptions contains all of poise's configuration option in one struct
// Every option can be omitted to use its default value
Expand Down
2 changes: 1 addition & 1 deletion examples/event_handler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Data {

#[tokio::main]
async fn main() {
env_logger::init();
tracing_subscriber::fmt::init();

let token = var("DISCORD_TOKEN")
.expect("Missing `DISCORD_TOKEN` env var, see README for more information.");
Expand Down
2 changes: 1 addition & 1 deletion examples/feature_showcase/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Data {}

#[tokio::main]
async fn main() {
env_logger::init();
tracing_subscriber::fmt::init();

let framework = poise::Framework::builder()
.options(poise::FrameworkOptions {
Expand Down
2 changes: 1 addition & 1 deletion examples/fluent_localization/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async fn register(ctx: Context<'_>) -> Result<(), Error> {

#[tokio::main]
async fn main() {
env_logger::init();
tracing_subscriber::fmt::init();

let mut commands = vec![welcome(), info(), register()];
let translations = translation::read_ftl().expect("failed to read translation files");
Expand Down
2 changes: 1 addition & 1 deletion src/builtins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use paginate::*;
use crate::{serenity::CreateAllowedMentions, serenity_prelude as serenity, CreateReply};

/// An error handler that logs errors either via the [`tracing`] crate or via a Discord message. Set
/// up a logger (e.g. `env_logger::init()`) or a tracing subscriber
/// up a logger like tracing subscriber
/// (e.g. `tracing_subscriber::fmt::init()`) to see the logged errors from this method.
///
/// If the user invoked the command wrong ([`crate::FrameworkError::ArgumentParse`]), the command
Expand Down

0 comments on commit f5c303a

Please sign in to comment.