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:
teernisse
2026-02-14 11:25:33 -05:00
parent bb6660178c
commit eef73decb5
5 changed files with 18 additions and 10 deletions

View File

@@ -301,7 +301,7 @@ fn print_timeline_footer(result: &TimelineResult) {
} }
/// Format event tag: pad plain text to TAG_WIDTH, then apply style. /// 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 { fn format_event_tag(event_type: &TimelineEventType) -> String {
let (label, style) = match event_type { let (label, style) = match event_type {

View File

@@ -1254,7 +1254,15 @@ mod tests {
#[test] #[test]
fn glyph_mode_force_ascii_is_fallback_when_no_explicit_icon_mode() { 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] #[test]

View File

@@ -51,8 +51,8 @@ pub fn build_stderr_filter(verbose: u8, quiet: bool) -> EnvFilter {
} }
let directives = match verbose { let directives = match verbose {
0 => "lore=info,warn", 0 => "lore=warn",
1 => "lore=debug,warn", 1 => "lore=info,warn",
2 => "lore=debug,info", 2 => "lore=debug,info",
_ => "lore=trace,debug", _ => "lore=trace,debug",
}; };

View File

@@ -2,7 +2,7 @@ use std::ops::Deref;
use futures::StreamExt; use futures::StreamExt;
use rusqlite::{Connection, Transaction}; use rusqlite::{Connection, Transaction};
use tracing::{debug, info, warn}; use tracing::{debug, warn};
use crate::Config; use crate::Config;
use crate::core::error::{LoreError, Result}; use crate::core::error::{LoreError, Result};
@@ -61,7 +61,7 @@ pub async fn ingest_issues(
while let Some(issue_result) = issues_stream.next().await { while let Some(issue_result) = issues_stream.next().await {
if signal.is_cancelled() { if signal.is_cancelled() {
info!("Issue ingestion interrupted by shutdown signal"); debug!("Issue ingestion interrupted by shutdown signal");
break; break;
} }
let issue = issue_result?; 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)?; result.issues_needing_discussion_sync = get_issues_needing_discussion_sync(conn, project_id)?;
info!( debug!(
summary = crate::ingestion::nonzero_summary(&[ summary = crate::ingestion::nonzero_summary(&[
("fetched", result.fetched), ("fetched", result.fetched),
("upserted", result.upserted), ("upserted", result.upserted),

View File

@@ -1,7 +1,7 @@
use std::ops::Deref; use std::ops::Deref;
use rusqlite::{Connection, Transaction, params}; use rusqlite::{Connection, Transaction, params};
use tracing::{debug, info, warn}; use tracing::{debug, warn};
use crate::Config; use crate::Config;
use crate::core::error::{LoreError, Result}; use crate::core::error::{LoreError, Result};
@@ -61,7 +61,7 @@ pub async fn ingest_merge_requests(
loop { loop {
if signal.is_cancelled() { if signal.is_cancelled() {
info!("MR ingestion interrupted by shutdown signal"); debug!("MR ingestion interrupted by shutdown signal");
break; break;
} }
let page_result = client let page_result = client
@@ -121,7 +121,7 @@ pub async fn ingest_merge_requests(
} }
} }
info!( debug!(
summary = crate::ingestion::nonzero_summary(&[ summary = crate::ingestion::nonzero_summary(&[
("fetched", result.fetched), ("fetched", result.fetched),
("upserted", result.upserted), ("upserted", result.upserted),