diff --git a/internal/cli/logs.go b/internal/cli/logs.go index 76c6a88ad..b938e671e 100644 --- a/internal/cli/logs.go +++ b/internal/cli/logs.go @@ -57,13 +57,10 @@ Show the tenant logs. if len(list) > 0 { lastLogID = list[len(list)-1].GetLogID() - } else { - cli.renderer.Infof("No logs found for tenant %s; to generate logs, run commands like `auth0 test login` or `auth0 test token`", cli.tenant) - return nil } var logsCh chan []*management.Log - if flags.Follow { + if flags.Follow && lastLogID != "" { logsCh = make(chan []*management.Log) go func() { diff --git a/internal/display/logs.go b/internal/display/logs.go index 1fa18665e..4f4c82f2c 100644 --- a/internal/display/logs.go +++ b/internal/display/logs.go @@ -195,6 +195,10 @@ func (v *logView) typeDesc() (typ, desc string) { func (r *Renderer) LogList(logs []*management.Log, ch <-chan []*management.Log, api auth0.ActionExecutionAPI, noColor, silent bool) { r.Heading(ansi.Bold(r.Tenant), "logs\n") + if len(logs) < 1 { + r.Infof("No logs found; to generate logs, run a test command like `auth0 test login` or `auth0 test token`") + } + var res []View for _, l := range logs { res = append(res, &logView{Log: l, ActionExecutionAPI: api, silent: silent, noColor: noColor})