feat: better logging output

0.3.x
Davide Polonio 2022-05-31 13:09:31 +02:00
parent 540c306483
commit 3066753c69
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "songlify"
version = "0.3.2"
version = "0.3.3"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,3 +1,4 @@
use log::LevelFilter;
use sentry::ClientInitGuard;
use std::env;
use teloxide::prelude::*;
@ -15,8 +16,16 @@ static MAX_ARTISTS_CHARS: usize = 140;
#[tokio::main]
async fn main() {
teloxide::enable_logging!();
if env::var("RUST_LOG").is_err() {
pretty_env_logger::formatted_builder()
.filter_module("songlify", LevelFilter::Info)
.filter_module("teloxide", LevelFilter::Info)
.init();
} else {
pretty_env_logger::init();
}
log::info!("Starting Songlify...");
log::trace!("You're running in trace mode!");
let mut _guard: ClientInitGuard;
match env::var("SENTRY_DSN") {