commands, helpers, vendor: Update to the latest jww logger - hugo - [fork] hugo port for 9front
 (HTM) git clone git@git.drkhsh.at/hugo.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit c344b1901fac755d44c889428f8972895d12fa66
 (DIR) parent 2ac9817eae7ddbb84c9d17c998d3ed004acc4b95
 (HTM) Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
       Date:   Tue,  3 Jan 2017 16:57:43 +0100
       
       commands, helpers, vendor: Update to the latest jww logger
       
       Updates #2701
       
       Diffstat:
         M commands/hugo.go                    |      20 ++++++++++++++++----
         M helpers/general.go                  |       2 +-
         M vendor/vendor.json                  |       6 +++---
       
       3 files changed, 20 insertions(+), 8 deletions(-)
       ---
 (DIR) diff --git a/commands/hugo.go b/commands/hugo.go
       @@ -17,6 +17,7 @@ package commands
        
        import (
                "fmt"
       +        "io/ioutil"
                "net/http"
                "os"
                "path/filepath"
       @@ -332,16 +333,27 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error {
                        viper.Set("cacheDir", helpers.GetTempDir("hugo_cache", hugofs.Source()))
                }
        
       +        logFile := ioutil.Discard
       +
                if verboseLog || logging || (viper.IsSet("logFile") && viper.GetString("logFile") != "") {
       +
       +                var err error
                        if viper.IsSet("logFile") && viper.GetString("logFile") != "" {
       -                        jww.SetLogFile(viper.GetString("logFile"))
       +                        path := viper.GetString("logFile")
       +                        logFile, err = os.OpenFile(path, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
       +                        if err != nil {
       +                                return newSystemError("Failed to open log file:", path, err)
       +                        }
                        } else {
       -                        jww.UseTempLogFile("hugo")
       +                        logFile, err = ioutil.TempFile(os.TempDir(), "hugo")
       +                        if err != nil {
       +                                return newSystemError(err)
       +                        }
                        }
       -        } else {
       -                jww.DiscardLogging()
                }
        
       +        jww.SetLogOutput(logFile)
       +
                if quiet {
                        jww.SetStdoutThreshold(jww.LevelError)
                } else if viper.GetBool("verbose") {
 (DIR) diff --git a/helpers/general.go b/helpers/general.go
       @@ -252,7 +252,7 @@ func NewDistinctErrorLogger() *DistinctLogger {
        // NewDistinctFeedbackLogger creates a new DistinctLogger that can be used
        // to give feedback to the user while not spamming with duplicates.
        func NewDistinctFeedbackLogger() *DistinctLogger {
       -        return &DistinctLogger{m: make(map[string]bool), logger: &jww.FEEDBACK}
       +        return &DistinctLogger{m: make(map[string]bool), logger: jww.FEEDBACK}
        }
        
        var (
 (DIR) diff --git a/vendor/vendor.json b/vendor/vendor.json
       @@ -281,10 +281,10 @@
                                "revisionTime": "2016-11-30T04:45:28Z"
                        },
                        {
       -                        "checksumSHA1": "dkruahfhuLXXuyeCuRpsWlcRK+8=",
       +                        "checksumSHA1": "7NGKyJZL8VItCxYkEJxNh8l9O18=",
                                "path": "github.com/spf13/jwalterweatherman",
       -                        "revision": "33c24e77fb80341fe7130ee7c594256ff08ccc46",
       -                        "revisionTime": "2016-03-01T12:00:06Z"
       +                        "revision": "14fe3f27973f14e5d1bb8bb16f6153cc67b30652",
       +                        "revisionTime": "2017-01-03T11:13:15Z"
                        },
                        {
                                "checksumSHA1": "zLJY+lsX1e5OO6gRxQd5RfKgdQY=",