Skip to content

Commit

Permalink
use existing renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
morganelle committed Mar 5, 2021
1 parent 265b589 commit df92778
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions internal/cli/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 4 additions & 0 deletions internal/display/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit df92778

Please sign in to comment.