Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): add console version logging #2061

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_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 @@
};

let address = SocketAddr::from((host, port));
info!("Listening at {}", address);
let version = env!("CARGO_PKG_VERSION");
println!(
r#"
████████╗ █████╗ ██████╗ ██████╗ ██╗ ██╗
╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗╚██╗ ██╔╝
██║ ███████║██████╔╝██████╔╝ ╚████╔╝
██║ ██╔══██║██╔══██╗██╔══██╗ ╚██╔╝
██║ ██║ ██║██████╔╝██████╔╝ ██║
╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝

📄 Version {version}
🚀 Listening at {address}
"#
);

Check warning on line 46 in crates/tabby/src/routes/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/routes/mod.rs#L33-L46

Added lines #L33 - L46 were not covered by tests
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 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 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...");

Check warning on line 121 in crates/tabby/src/serve.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/serve.rs#L121

Added line #L121 was not covered by tests

#[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 @@
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 @@
loop {
match CodeSearchImpl::load(repository_access.clone()) {
Ok(code) => {
info!("Index is ready, enabling server...");
debug!("Index is ready, enabling code search...");

Check warning on line 60 in crates/tabby/src/services/code.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/services/code.rs#L60

Added line #L60 was not covered by tests
return code;
}
Err(err) => {
Expand Down
Loading