diff --git a/src/main.rs b/src/main.rs index a0cdfb0..68ce060 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use crates_io_api::AsyncClient; use rustina::{ handler, - utils::{github::GitHub, groups::Groups, resources::Resources, cargo_like_log}, + utils::{cargo_like_log, github::GitHub, groups::Groups, resources::Resources}, }; use std::error::Error; use teloxide::{prelude::*, update_listeners::webhooks}; @@ -38,7 +38,7 @@ async fn main() -> Result<(), Box> { match std::env::var("WEBHOOK_URL") { Ok(v) => { - cargo_like_log("Mode", &format!("Starting webhook on {}", v)); + cargo_like_log("Mode", &format!("starting webhook on {}", v)); let addr = ([0, 0, 0, 0], 8443).into(); // port 8443 let listener = webhooks::axum(bot, webhooks::Options::new(addr, v.parse().unwrap())) .await @@ -54,7 +54,7 @@ async fn main() -> Result<(), Box> { .await; } Err(_) => { - cargo_like_log("Mode", "Starting polling on localhost"); + cargo_like_log("Mode", "starting polling on localhost"); dispatcher.dispatch().await; } } diff --git a/src/utils/mod.rs b/src/utils/mod.rs index e9b6636..1865a24 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -6,12 +6,11 @@ pub mod message; pub mod resources; pub fn cargo_like_log(title: &str, message: &str) { - println!("{}{}{}{} {} {}", + println!( + "{}\x1b[1;32m{}\x1b[0m {} {}", " ".repeat(12 - title.len()), - "\x1b[1;32m", title, - "\x1b[0m", message, " ".repeat(8) ); -} \ No newline at end of file +}