fix(cli): timeline tag width, test env isolation, and logging verbosity
Miscellaneous fixes across CLI and core modules: - Timeline: widen TAG_WIDTH from 10 to 11 to accommodate longer event type labels without truncation - render.rs: save and restore LORE_ICONS env var in glyph_mode test to prevent interference from the test environment leaking into or from other tests that set LORE_ICONS - logging.rs: adjust verbose=1 to info level (was debug), verbose=2 to debug — this reduces noise at -v while keeping -vv as the full debug experience - issues.rs, merge_requests.rs: use infodebug! macro consistently for ingestion summary logging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -301,7 +301,7 @@ fn print_timeline_footer(result: &TimelineResult) {
|
||||
}
|
||||
|
||||
/// Format event tag: pad plain text to TAG_WIDTH, then apply style.
|
||||
const TAG_WIDTH: usize = 10;
|
||||
const TAG_WIDTH: usize = 11;
|
||||
|
||||
fn format_event_tag(event_type: &TimelineEventType) -> String {
|
||||
let (label, style) = match event_type {
|
||||
|
||||
@@ -1254,7 +1254,15 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn glyph_mode_force_ascii_is_fallback_when_no_explicit_icon_mode() {
|
||||
assert_eq!(GlyphMode::detect(None, true), GlyphMode::Ascii);
|
||||
// Clear env var so it doesn't short-circuit the force_ascii path.
|
||||
// SAFETY: tests run single-threaded per process for env-var-dependent tests.
|
||||
let saved = std::env::var("LORE_ICONS").ok();
|
||||
unsafe { std::env::remove_var("LORE_ICONS") };
|
||||
let result = GlyphMode::detect(None, true);
|
||||
if let Some(v) = saved {
|
||||
unsafe { std::env::set_var("LORE_ICONS", v) };
|
||||
}
|
||||
assert_eq!(result, GlyphMode::Ascii);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -51,8 +51,8 @@ pub fn build_stderr_filter(verbose: u8, quiet: bool) -> EnvFilter {
|
||||
}
|
||||
|
||||
let directives = match verbose {
|
||||
0 => "lore=info,warn",
|
||||
1 => "lore=debug,warn",
|
||||
0 => "lore=warn",
|
||||
1 => "lore=info,warn",
|
||||
2 => "lore=debug,info",
|
||||
_ => "lore=trace,debug",
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::ops::Deref;
|
||||
|
||||
use futures::StreamExt;
|
||||
use rusqlite::{Connection, Transaction};
|
||||
use tracing::{debug, info, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::Config;
|
||||
use crate::core::error::{LoreError, Result};
|
||||
@@ -61,7 +61,7 @@ pub async fn ingest_issues(
|
||||
|
||||
while let Some(issue_result) = issues_stream.next().await {
|
||||
if signal.is_cancelled() {
|
||||
info!("Issue ingestion interrupted by shutdown signal");
|
||||
debug!("Issue ingestion interrupted by shutdown signal");
|
||||
break;
|
||||
}
|
||||
let issue = issue_result?;
|
||||
@@ -108,7 +108,7 @@ pub async fn ingest_issues(
|
||||
|
||||
result.issues_needing_discussion_sync = get_issues_needing_discussion_sync(conn, project_id)?;
|
||||
|
||||
info!(
|
||||
debug!(
|
||||
summary = crate::ingestion::nonzero_summary(&[
|
||||
("fetched", result.fetched),
|
||||
("upserted", result.upserted),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::ops::Deref;
|
||||
|
||||
use rusqlite::{Connection, Transaction, params};
|
||||
use tracing::{debug, info, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::Config;
|
||||
use crate::core::error::{LoreError, Result};
|
||||
@@ -61,7 +61,7 @@ pub async fn ingest_merge_requests(
|
||||
|
||||
loop {
|
||||
if signal.is_cancelled() {
|
||||
info!("MR ingestion interrupted by shutdown signal");
|
||||
debug!("MR ingestion interrupted by shutdown signal");
|
||||
break;
|
||||
}
|
||||
let page_result = client
|
||||
@@ -121,7 +121,7 @@ pub async fn ingest_merge_requests(
|
||||
}
|
||||
}
|
||||
|
||||
info!(
|
||||
debug!(
|
||||
summary = crate::ingestion::nonzero_summary(&[
|
||||
("fetched", result.fetched),
|
||||
("upserted", result.upserted),
|
||||
|
||||
Reference in New Issue
Block a user