Tried to add dependencies only for "dev" profile, but not successful. Conditional compiling has been added
This commit is contained in:
parent
6bde201ca2
commit
b5a9315a2d
|
@ -1,5 +1,6 @@
|
|||
[profile.release]
|
||||
opt-level = 3
|
||||
overflow-checks = false
|
||||
|
||||
[package]
|
||||
name = "dorya"
|
||||
|
@ -9,11 +10,13 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
actix-web = "4.6.0"
|
||||
anyhow = "1.0.86"
|
||||
async-trait = "0.1.80"
|
||||
chrono = "0.4.38"
|
||||
dotenvy = "0.15.7"
|
||||
telers = { git = "https://github.com/doryan04/telers.git" }
|
||||
tokio = { version="1.37.0", features=["rt-multi-thread"] }
|
||||
tracing = "0.1.40"
|
||||
tracing = {version = "0.1.40"}
|
||||
tracing-subscriber = {version="0.3.18", features=["env-filter"]}
|
||||
|
||||
|
|
24
src/main.rs
24
src/main.rs
|
@ -7,8 +7,6 @@ use telers::{
|
|||
Bot, Dispatcher, Router,
|
||||
};
|
||||
|
||||
use tracing_subscriber::{fmt, layer::SubscriberExt as _, util::SubscriberInitExt as _, EnvFilter};
|
||||
|
||||
mod assets;
|
||||
mod middlewares;
|
||||
mod types;
|
||||
|
@ -22,12 +20,29 @@ use handlers::{
|
|||
dice_handler::dice::dice_handler,
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
#[cfg(debug_assertions)]
|
||||
fn logs() {
|
||||
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt as _, EnvFilter};
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(fmt::layer())
|
||||
.with(EnvFilter::from_env("RUST_LOG"))
|
||||
.init();
|
||||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
fn logs() {
|
||||
println!(
|
||||
"
|
||||
Logs is able in only debug mode. Start bot with command \"cargo run\"\n
|
||||
Логи доступны только в режиме дебаг. Запустите бота командой \"cargo run\".
|
||||
"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
logs();
|
||||
|
||||
dotenv().ok();
|
||||
|
||||
|
@ -37,7 +52,6 @@ async fn main() {
|
|||
let bot = Bot::new(token);
|
||||
|
||||
let mut route = Router::new("main");
|
||||
|
||||
let mut dice = Router::new("dice");
|
||||
|
||||
dice.message
|
||||
|
|
Loading…
Reference in New Issue