From ce175c3415358fcf1deb069da816b7174c381b05 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Mon, 6 May 2024 11:41:53 -0700 Subject: [PATCH 1/3] chore(core): add console version logging --- crates/tabby/src/routes/mod.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/tabby/src/routes/mod.rs b/crates/tabby/src/routes/mod.rs index 7b8f8564b288..25124dee08d7 100644 --- a/crates/tabby/src/routes/mod.rs +++ b/crates/tabby/src/routes/mod.rs @@ -31,7 +31,20 @@ pub async fn run_app(api: Router, ui: Option, host: IpAddr, port: u16) { }; let address = SocketAddr::from((host, port)); - info!("Listening at {}", address); + let version = env!("CARGO_PKG_VERSION"); + println!( + r#" +████████╗ █████╗ ██████╗ ██████╗ ██╗ ██╗ +╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗╚██╗ ██╔╝ + ██║ ███████║██████╔╝██████╔╝ ╚████╔╝ + ██║ ██╔══██║██╔══██╗██╔══██╗ ╚██╔╝ + ██║ ██║ ██║██████╔╝██████╔╝ ██║ + ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ + +📄 Version {version} +🚀 Listening at {address} +"# + ); let listener = tokio::net::TcpListener::bind(address).await.unwrap(); axum::serve( From affdfe7df9960691aa20ec9707aa6e8100a72135 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Mon, 6 May 2024 13:05:25 -0700 Subject: [PATCH 2/3] change log level --- crates/tabby/src/serve.rs | 4 ++-- crates/tabby/src/services/code.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/tabby/src/serve.rs b/crates/tabby/src/serve.rs index f6bade3babce..eb5c417b23c3 100644 --- a/crates/tabby/src/serve.rs +++ b/crates/tabby/src/serve.rs @@ -11,7 +11,7 @@ use tabby_common::{ }; use tokio::time::sleep; use tower_http::timeout::TimeoutLayer; -use tracing::{info, warn}; +use tracing::{debug, info, warn}; use utoipa::{ openapi::security::{HttpAuthScheme, HttpBuilder, SecurityScheme}, Modify, OpenApi, @@ -118,7 +118,7 @@ pub struct ServeArgs { pub async fn main(config: &Config, args: &ServeArgs) { load_model(args).await; - info!("Starting server, this might take a few minutes..."); + debug!("Starting server, this might take a few minutes..."); #[cfg(feature = "ee")] #[allow(deprecated)] diff --git a/crates/tabby/src/services/code.rs b/crates/tabby/src/services/code.rs index 66744eac62e1..551986d72aae 100644 --- a/crates/tabby/src/services/code.rs +++ b/crates/tabby/src/services/code.rs @@ -57,7 +57,7 @@ impl CodeSearchImpl { loop { match CodeSearchImpl::load(repository_access.clone()) { Ok(code) => { - info!("Index is ready, enabling server..."); + debug!("Index is ready, enabling code search..."); return code; } Err(err) => { From 5f2e98e3e50743bdb78fdbc5481bb5c5d0e83e21 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Mon, 6 May 2024 13:11:28 -0700 Subject: [PATCH 3/3] update --- crates/tabby/src/routes/mod.rs | 1 - crates/tabby/src/serve.rs | 2 +- crates/tabby/src/services/code.rs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/tabby/src/routes/mod.rs b/crates/tabby/src/routes/mod.rs index 25124dee08d7..641cc5295943 100644 --- a/crates/tabby/src/routes/mod.rs +++ b/crates/tabby/src/routes/mod.rs @@ -10,7 +10,6 @@ use axum_extra::headers::Header; use axum_prometheus::PrometheusMetricLayer; use tabby_common::constants::USER_HEADER_FIELD_NAME; use tower_http::cors::CorsLayer; -use tracing::info; use crate::fatal; diff --git a/crates/tabby/src/serve.rs b/crates/tabby/src/serve.rs index eb5c417b23c3..a33c01aa4243 100644 --- a/crates/tabby/src/serve.rs +++ b/crates/tabby/src/serve.rs @@ -11,7 +11,7 @@ use tabby_common::{ }; use tokio::time::sleep; use tower_http::timeout::TimeoutLayer; -use tracing::{debug, info, warn}; +use tracing::{debug, warn}; use utoipa::{ openapi::security::{HttpAuthScheme, HttpBuilder, SecurityScheme}, Modify, OpenApi, diff --git a/crates/tabby/src/services/code.rs b/crates/tabby/src/services/code.rs index 551986d72aae..33ce69be93c5 100644 --- a/crates/tabby/src/services/code.rs +++ b/crates/tabby/src/services/code.rs @@ -18,7 +18,7 @@ use tantivy::{ DocAddress, Document, Index, IndexReader, }; use tokio::{sync::Mutex, time::sleep}; -use tracing::{debug, log::info}; +use tracing::debug; struct CodeSearchImpl { reader: IndexReader,