Skip to content

Commit 5c5816b

Browse files
committed
Tweak log messages a bit
Signed-off-by: Jim Crossley <[email protected]>
1 parent 75258fc commit 5c5816b

File tree

5 files changed

+10
-28
lines changed

5 files changed

+10
-28
lines changed

modules/importer/src/runner/common/walker/git.rs

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ where
177177
}
178178

179179
/// Sync version, as all git functions are sync
180-
#[instrument(skip(self), ret)]
180+
#[instrument(skip(self))]
181181
fn run_sync(mut self) -> Result<Continuation, Error> {
182182
log::debug!("Starting run for: {}", self.source);
183183

@@ -188,16 +188,11 @@ where
188188

189189
let path = working_dir.as_ref();
190190

191-
log::info!("Cloning {} into {}", self.source, path.display());
192-
193191
// clone or open repository
194-
195192
let repo = self.clone_or_update_repo(path)?;
196-
197193
log::info!("Repository cloned or updated");
198194

199195
// discover files between "then" and now
200-
201196
let changes = self.find_changes(&repo)?;
202197

203198
// discover and process files
@@ -240,11 +235,8 @@ where
240235
let repo = info_span!("open repository").in_scope(|| Repository::open(path))?;
241236

242237
let repo = info_span!("fetching updates").in_scope(move || {
243-
log::info!("Fetching updates");
244-
245238
self.progress
246239
.message_sync(format!("Fetching updates: {}", self.source));
247-
248240
{
249241
let mut remote = repo.find_remote("origin")?;
250242
let mut fo = Self::create_fetch_options();
@@ -294,7 +286,7 @@ where
294286
}
295287
}
296288

297-
#[instrument(skip(self), err)]
289+
#[instrument(skip(self))]
298290
fn clone_repo(&self, path: &Path) -> Result<Repository, git2::Error> {
299291
self.progress
300292
.message_sync(format!("Cloning repository: {}", self.source));
@@ -318,7 +310,7 @@ where
318310
Some(commit) => {
319311
log::info!("Continuing from: {commit}");
320312

321-
let files = info_span!("continue from", commit).in_scope(|| {
313+
info_span!("continue from", commit).in_scope(|| {
322314
let start = match repo.find_commit(repo.revparse_single(commit)?.id()) {
323315
Ok(start) => start,
324316
Err(err)
@@ -358,26 +350,17 @@ where
358350
}
359351

360352
Ok(Some(files))
361-
})?;
362-
363-
if let Some(files) = &files {
364-
log::info!("Detected {} changed files", files.len());
365-
}
366-
367-
files
368-
}
369-
_ => {
370-
log::debug!("Ingesting all files");
371-
None
353+
})?
372354
}
355+
_ => None,
373356
};
374357

375358
match &result {
376359
Some(result) => {
377360
log::info!("Detected {} changed files", result.len());
378361
}
379362
None => {
380-
log::debug!("Ingesting all files");
363+
log::info!("Ingesting all files");
381364
}
382365
}
383366

modules/importer/src/runner/cve/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<C: RunContext> Callbacks<Vec<u8>> for Context<C> {
7070
}
7171

7272
impl super::ImportRunner {
73-
#[instrument(skip(self), ret)]
73+
#[instrument(skip(self, context))]
7474
pub async fn run_once_cve(
7575
&self,
7676
context: impl RunContext + 'static,

modules/importer/src/runner/osv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<C: RunContext> Callbacks<Vec<u8>> for Context<C> {
9797
}
9898

9999
impl super::ImportRunner {
100-
#[instrument(skip(self), ret)]
100+
#[instrument(skip(self, context))]
101101
pub async fn run_once_osv(
102102
&self,
103103
context: impl RunContext + 'static,

modules/importer/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl ImporterService {
247247
.await
248248
}
249249

250-
#[instrument(skip(self, report), ret)]
250+
#[instrument(skip(self, report, continuation))]
251251
pub async fn update_finish(
252252
&self,
253253
name: &str,

modules/ingestor/src/service/advisory/osv/loader.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ impl<'g> OsvLoader<'g> {
105105
advisory_vuln.ingest_cvss3_score(cvss3, &tx).await?;
106106
}
107107
Err(err) => {
108-
let msg = format!("Unable to parse CVSS3: {:#?}", err);
109-
log::info!("{msg}");
108+
let msg = format!("Unable to parse CVSS3: {err}");
110109
warnings.error(msg)
111110
}
112111
}

0 commit comments

Comments
 (0)