From 04f11977f59ae2824fa2c7256c8ee7f3a65e3360 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Sun, 20 Mar 2016 23:34:10 +0100 Subject: [PATCH] Fixes setting log levels --- cmd/root.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 0fa6f4c..764cab0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -37,6 +37,9 @@ var RootCmd = &cobra.Command{ The main purpose is to help in the compilation of your lilypond files into both single files and a fully functioning song book. It also accepts other PDF files to be part of your song book.`, + PersistentPreRun: func(cmd *cobra.Command, args []string) { + setLogLevel() + }, // Uncomment the following line if your bare application // has an action associated with it: // Run: func(cmd *cobra.Command, args []string) { }, @@ -53,8 +56,6 @@ func Execute() { func init() { RootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Verbose output of application events") RootCmd.PersistentFlags().BoolVar(&veryVerbose, "vv", false, "Debug output of application events") - - setLogLevel() } func setLogLevel() {