renderToMemory bool // for benchmark testing
verbose bool
verboseLog bool
+ debug bool
quiet bool
)
// init initializes flags.
func init() {
HugoCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose output")
+ HugoCmd.PersistentFlags().BoolVarP(&debug, "debug", "", false, "debug output")
HugoCmd.PersistentFlags().BoolVar(&logging, "log", false, "enable Logging")
HugoCmd.PersistentFlags().StringVar(&logFile, "logFile", "", "log File path (if set, logging enabled automatically)")
HugoCmd.PersistentFlags().BoolVar(&verboseLog, "verboseLog", false, "verbose logging")
stdoutThreshold = jww.LevelInfo
}
+ if cfg.GetBool("debug") {
+ stdoutThreshold = jww.LevelDebug
+ }
+
if verboseLog {
logThreshold = jww.LevelInfo
+ if cfg.GetBool("debug") {
+ logThreshold = jww.LevelDebug
+ }
}
// The global logger is used in some few cases.
}
func (c *commandeer) initializeFlags(cmd *cobra.Command) {
- persFlagKeys := []string{"verbose", "logFile"}
+ persFlagKeys := []string{"debug", "verbose", "logFile"}
flagKeys := []string{
"cleanDestinationDir",
"buildDrafts",
v.SetDefault("enableGitInfo", false)
v.SetDefault("ignoreFiles", make([]string, 0))
v.SetDefault("disableAliases", false)
+ v.SetDefault("debug", false)
}