From 9983c466ec92df3eb3ff44e4d9589fd7fb4fd8bc Mon Sep 17 00:00:00 2001 From: LexLuthr <88259624+LexLuthr@users.noreply.github.com> Date: Thu, 23 May 2024 16:34:28 +0530 Subject: [PATCH] fix logs (#12036) --- cli/spcli/sectors.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/spcli/sectors.go b/cli/spcli/sectors.go index ee338932c..1dad6ada2 100644 --- a/cli/spcli/sectors.go +++ b/cli/spcli/sectors.go @@ -266,12 +266,14 @@ func SectorsStatusCmd(getActorAddress ActorAddressGetter, getOnDiskInfo OnDiskIn } if cctx.Bool("log") { - fmt.Printf("--------\nEvent Log:\n") + if getOnDiskInfo != nil { + fmt.Printf("--------\nEvent Log:\n") - for i, l := range status.Log { - fmt.Printf("%d.\t%s:\t[%s]\t%s\n", i, time.Unix(int64(l.Timestamp), 0), l.Kind, l.Message) - if l.Trace != "" { - fmt.Printf("\t%s\n", l.Trace) + for i, l := range status.Log { + fmt.Printf("%d.\t%s:\t[%s]\t%s\n", i, time.Unix(int64(l.Timestamp), 0), l.Kind, l.Message) + if l.Trace != "" { + fmt.Printf("\t%s\n", l.Trace) + } } } }