summaryrefslogtreecommitdiffstats
path: root/helpers
diff options
context:
space:
mode:
authorspf13 <steve.francia@gmail.com>2014-03-31 13:23:34 -0400
committerspf13 <steve.francia@gmail.com>2014-03-31 13:23:34 -0400
commite50b9d8ac1c69aa16cf45b1e4ff95b22d535adb7 (patch)
tree8c16489a5cf2631649805d547256d4427d9486d8 /helpers
parent2fa3761ec993657330d5b9ddbaaab1f58797fb61 (diff)
Adding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #137
Diffstat (limited to 'helpers')
-rw-r--r--helpers/pygments.go8
-rw-r--r--helpers/url.go3
2 files changed, 5 insertions, 6 deletions
diff --git a/helpers/pygments.go b/helpers/pygments.go
index 28b296227..a858fba4b 100644
--- a/helpers/pygments.go
+++ b/helpers/pygments.go
@@ -15,16 +15,18 @@ package helpers
import (
"bytes"
- "log"
"os/exec"
"strings"
+
+ jww "github.com/spf13/jwalterweatherman"
)
func Highlight(code string, lexer string) string {
var pygmentsBin = "pygmentize"
if _, err := exec.LookPath(pygmentsBin); err != nil {
- log.Print("Highlighting requries Pygments to be installed and in the path")
+
+ jww.WARN.Println("Highlighting requries Pygments to be installed and in the path")
return code
}
@@ -37,7 +39,7 @@ func Highlight(code string, lexer string) string {
cmd.Stderr = &stderr
if err := cmd.Run(); err != nil {
- log.Print(stderr.String())
+ jww.ERROR.Print(stderr.String())
return code
}
diff --git a/helpers/url.go b/helpers/url.go
index e3428eda6..ffafe7af0 100644
--- a/helpers/url.go
+++ b/helpers/url.go
@@ -14,13 +14,10 @@
package helpers
import (
- "fmt"
"net/url"
"path"
)
-var _ = fmt.Println
-
// Similar to MakePath, but with Unicode handling
// Example:
// uri: Vim (text editor)