Skip to content

Commit

Permalink
chore(core): add console version logging (#2061)
Browse files Browse the repository at this point in the history
* chore(core): add console version logging

* change log level

* update
  • Loading branch information
wsxiaoys committed May 8, 2024
1 parent 9a321c6 commit d1507d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
16 changes: 14 additions & 2 deletions crates/tabby/src/routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -31,7 +30,20 @@ pub async fn run_app(api: Router, ui: Option<Router>, 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(
Expand Down
4 changes: 2 additions & 2 deletions crates/tabby/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use tabby_common::{
};
use tokio::time::sleep;
use tower_http::timeout::TimeoutLayer;
use tracing::{info, warn};
use tracing::{debug, warn};
use utoipa::{
openapi::security::{HttpAuthScheme, HttpBuilder, SecurityScheme},
Modify, OpenApi,
Expand Down Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions crates/tabby/src/services/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit d1507d1

Please sign in to comment.