mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Verbose debug logging via the ConsolePrinter and printer package. (#404)
This: * adds a global -v flag for verbosity * refactors the "printer" package to have a DefaultPrinter and package functions that call it, similar to net/http's DefaultServeMux * adds printer tests * moves current users of Debugf to Printf * moves most users of the "log" package to use "printer" * demotes noticably noisy log messages to "Debugf", like "IGNORE"- and "NO_PURGE"-related messages
This commit is contained in:
committed by
Craig Peterson
parent
f58acabe9f
commit
06ee4d6fb1
@ -10,6 +10,7 @@ import (
|
||||
"github.com/StackExchange/dnscontrol/models"
|
||||
"github.com/StackExchange/dnscontrol/pkg/acme"
|
||||
"github.com/StackExchange/dnscontrol/pkg/normalize"
|
||||
"github.com/StackExchange/dnscontrol/pkg/printer"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@ -88,7 +89,7 @@ func (args *GetCertsArgs) flags() []cli.Flag {
|
||||
flags = append(flags, cli.BoolFlag{
|
||||
Name: "verbose",
|
||||
Destination: &args.Verbose,
|
||||
Usage: "Enable detailed logging from acme library",
|
||||
Usage: "Enable detailed logging (deprecated: use the global -v flag)",
|
||||
})
|
||||
return flags
|
||||
}
|
||||
@ -150,7 +151,8 @@ func GetCerts(args GetCertsArgs) error {
|
||||
return err
|
||||
}
|
||||
for _, cert := range certList {
|
||||
_, err := client.IssueOrRenewCert(cert, args.RenewUnderDays, args.Verbose)
|
||||
v := args.Verbose || printer.DefaultPrinter.Verbose
|
||||
_, err := client.IssueOrRenewCert(cert, args.RenewUnderDays, v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user