1
0
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:
Ed Bardsley
2018-10-08 13:10:44 -07:00
committed by Craig Peterson
parent f58acabe9f
commit 06ee4d6fb1
12 changed files with 143 additions and 55 deletions

View File

@ -8,6 +8,7 @@ import (
"strings"
"github.com/StackExchange/dnscontrol/models"
"github.com/StackExchange/dnscontrol/pkg/printer"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
@ -44,6 +45,13 @@ func Run(v string) int {
app.Name = "dnscontrol"
app.HideVersion = true
app.Usage = "dnscontrol is a compiler and DSL for managing dns zones"
app.Flags = []cli.Flag{
cli.BoolFlag{
Name: "v",
Usage: "Enable detailed logging",
Destination: &printer.DefaultPrinter.Verbose,
},
}
sort.Sort(cli.CommandsByName(commands))
app.Commands = commands
app.EnableBashCompletion = true