Skip to content

Commit 7e72703

Browse files
Logging improvements (#82)
* Log scanning of ecosystems This is helpful to see the scan progress, especially in large projects with lots of files, and also relevant for being able to effectively use the `--excluded-ecosystems` parameter. * Add more info-level logs This helps tracking progress in CI --------- Co-authored-by: Douglas <douglas@socket.dev>
1 parent 1ad4995 commit 7e72703

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

socketsecurity/core/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ def find_files(self, path: str) -> List[str]:
187187
for ecosystem in patterns:
188188
if ecosystem in self.config.excluded_ecosystems:
189189
continue
190+
log.info(f'Scanning ecosystem: {ecosystem}')
190191
ecosystem_patterns = patterns[ecosystem]
191192
for file_name in ecosystem_patterns:
192193
original_pattern = ecosystem_patterns[file_name]["pattern"]
@@ -209,7 +210,7 @@ def find_files(self, path: str) -> List[str]:
209210
glob_end = time.time()
210211
log.debug(f"Globbing took {glob_end - glob_start:.4f} seconds")
211212

212-
log.debug(f"Total files found: {len(files)}")
213+
log.info(f"Total files found: {len(files)}")
213214
return sorted(files)
214215

215216
def get_supported_patterns(self) -> Dict:
@@ -331,7 +332,7 @@ def create_full_scan(self, files: list[tuple[str, tuple[str, BytesIO]]], params:
331332
Returns:
332333
FullScan object with scan results
333334
"""
334-
log.debug("Creating new full scan")
335+
log.info("Creating new full scan")
335336
create_full_start = time.time()
336337

337338
res = self.sdk.fullscans.post(files, params, use_types=True)

0 commit comments

Comments
 (0)