Skip to content

Add a quiet flag#12

Merged
stevvooe merged 1 commit intocontainerd:masterfrom
dnephin:add-quiet-flag
Dec 15, 2017
Merged

Add a quiet flag#12
stevvooe merged 1 commit intocontainerd:masterfrom
dnephin:add-quiet-flag

Conversation

@dnephin
Copy link
Copy Markdown
Contributor

@dnephin dnephin commented Dec 11, 2017

To suppress verbose output

Comment thread main.go
fmt.Println(arg)
if !quiet {
fmt.Println(arg)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an error, would it possible to still print the command? It makes it easier to debug generation issues.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, that makes sense to me. The error would be any error that occurs after this line, right?

I could handle it by adding something like this:

} else {
    log.SetPrefix(fmt.Sprintf("command %s", arg))
}

but that might make for some strange log messages.

Another option would be moving everything below this out into a new function which returns errors instead of log.Fatal() and adding the extra text here in the if err != nil.

WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at it again, I guess it's really only the protoc.run() error that needs to be handled, so I added a log.Println(err) to that if block.

Signed-off-by: Daniel Nephin <[email protected]>
@crosbymichael
Copy link
Copy Markdown
Member

ping

@stevvooe
Copy link
Copy Markdown
Member

LGTM

@stevvooe stevvooe merged commit d3f048d into containerd:master Dec 15, 2017
@dnephin dnephin deleted the add-quiet-flag branch December 15, 2017 21:35
justai-net pushed a commit to justai-net/protobuild that referenced this pull request Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants