func initLogging() error {
	zerolog.SetGlobalLevel(zerolog.TraceLevel)
	if viper.GetString("log-file") != "" {
		f, err := os.OpenFile(resolvePath(viper.GetString("log-file")), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
		if err != nil {
			return errors.Wrap(err, "failed to open log file")
		}
		zerologger.Logger = zerologger.Logger.Output(f)
	}
	log = zerologger.Logger.With().Logger().Level(util.LogLevel(""))
	return nil
}
initLogging initialises logging.
package main
import (
	"os"
	"github.com/attestantio/vouch/util"
	"github.com/pkg/errors"
	"github.com/rs/zerolog"
	zerologger "github.com/rs/zerolog/log"
	"github.com/spf13/viper"
)
var log zerolog.Logger