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

feat: enable tabby to print debug logs #812

Closed
wants to merge 7 commits into from
Closed
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
8 changes: 4 additions & 4 deletions crates/tabby/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use opentelemetry::{
};
use opentelemetry_otlp::WithExportConfig;
use tabby_common::config::Config;
use tracing::metadata::LevelFilter;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer};

#[derive(Parser)]
Expand Down Expand Up @@ -174,10 +175,9 @@ fn init_logging(otlp_endpoint: Option<String>) {
};
}

let env_filter = EnvFilter::from_default_env()
.add_directive("tabby=info".parse().unwrap())
.add_directive("axum_tracing_opentelemetry=info".parse().unwrap())
.add_directive("otel=debug".parse().unwrap());
let env_filter = EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy();

tracing_subscriber::registry()
.with(layers)
Expand Down
8 changes: 8 additions & 0 deletions website/docs/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ import CodeBlock from '@theme/CodeBlock';
<p>For details on the registry format, please refer to <a href="https://github.com/TabbyML/registry-tabby/blob/main/models.json">models.json</a></p>
</div>
</details>

<details>
<summary>Why can't I see the debug logs?</summary>
<div>
<p>The default log level for tabby server is info.</p>
<p>To enable debug logs, add <code>RUST_LOG=debug</code> environment before tabby command, e.g. <code>RUST_LOG=debug tabbyml/tabby serve --model TabbyML/SantaCoder-1B --device cuda</code>.</p>
</div>
</details>
Loading