@@ -37,6 +37,7 @@ def __init__(self, *args: Any, verbose: bool = False, **kwargs: Any) -> None:
3737 self .setLevel (logging .DEBUG )
3838 self .command = ""
3939 self .logs : list [str ] = []
40+ self .error_logs : list [str ] = []
4041 self .description_table = Table (show_header = False , box = None )
4142 self .description_table_content : dict [str , str | Status ] = {
4243 "Package URL:" : Status ("[green]Processing[/]" ),
@@ -118,6 +119,7 @@ def emit(self, record: logging.LogRecord) -> None:
118119
119120 if record .levelno >= logging .ERROR :
120121 self .logs .append (f"[red][ERROR][/red] { log_time } { msg } " )
122+ self .error_logs .append (f"[red][ERROR][/red] { log_time } { msg } " )
121123 elif record .levelno >= logging .WARNING :
122124 self .logs .append (f"[yellow][WARNING][/yellow] { log_time } { msg } " )
123125 else :
@@ -386,10 +388,17 @@ def make_layout(self) -> Group:
386388 A rich Group object containing the layout for the live console display.
387389 """
388390 layout : list [RenderableType ] = []
391+ if self .error_logs :
392+ error_log_panel = Panel (
393+ "\n " .join (self .error_logs ),
394+ title = "Error Logs" ,
395+ title_align = "left" ,
396+ border_style = "red" ,
397+ )
398+ layout = layout + [error_log_panel ]
389399 if self .command == "analyze" :
390- layout = layout + [Rule (" DESCRIPTION" , align = "left" )]
391400 if self .description_table .row_count > 0 :
392- layout = layout + ["" , self .description_table ]
401+ layout = layout + [Rule ( " DESCRIPTION" , align = "left" ), "" , self .description_table ]
393402 if self .progress_table .row_count > 0 :
394403 layout = layout + ["" , self .progress , "" , self .progress_table ]
395404 if self .failed_checks_table .row_count > 0 :
@@ -418,25 +427,25 @@ def make_layout(self) -> Group:
418427 ]
419428 elif self .command == "verify-policy" :
420429 if self .policy_summary_table .row_count > 0 :
421- if self .components_violates_table .row_count > 0 :
430+ if self .components_satisfy_table .row_count > 0 :
422431 layout = layout + [
423- "[bold red ] Components Violate Policy[/]" ,
424- self .components_violates_table ,
432+ "[bold green ] Components Satisfy Policy[/]" ,
433+ self .components_satisfy_table ,
425434 ]
426435 else :
427436 layout = layout + [
428- "[bold red ] Components Violate Policy[/] [white not italic]None[/]" ,
437+ "[bold green ] Components Satisfy Policy[/] [white not italic]None[/]" ,
429438 ]
430- if self .components_satisfy_table .row_count > 0 :
439+ if self .components_violates_table .row_count > 0 :
431440 layout = layout + [
432441 "" ,
433- "[bold green ] Components Satisfy Policy[/]" ,
434- self .components_satisfy_table ,
442+ "[bold red ] Components Violate Policy[/]" ,
443+ self .components_violates_table ,
435444 ]
436445 else :
437446 layout = layout + [
438447 "" ,
439- "[bold green ] Components Satisfy Policy[/] [white not italic]None[/]" ,
448+ "[bold red ] Components Violate Policy[/] [white not italic]None[/]" ,
440449 ]
441450 layout = layout + ["" , self .policy_summary_table ]
442451 if self .verification_summary_attestation :
@@ -448,10 +457,11 @@ def make_layout(self) -> Group:
448457 "[bold blue]Verification Summary Attestation[/]" ,
449458 self .verification_summary_attestation ,
450459 )
451- vsa_table .add_row (
452- "[bold blue]Decode and Inspect the Content[/]" ,
453- f"cat { self .verification_summary_attestation } | jq -r [white]'.payload'[/] | base64 -d | jq" ,
454- )
460+ if self .verification_summary_attestation != "No VSA generated." :
461+ vsa_table .add_row (
462+ "[bold blue]Decode and Inspect the Content[/]" ,
463+ f"cat { self .verification_summary_attestation } | jq -r [white]'.payload'[/] | base64 -d | jq" ,
464+ )
455465
456466 layout = layout + [vsa_table ]
457467 elif self .command == "find-source" :
0 commit comments