Skip to content

Commit

Permalink
Merge pull request #7 from hatch-is/fix-logs
Browse files Browse the repository at this point in the history
Fix: log
  • Loading branch information
andreychuk authored Oct 27, 2016
2 parents 4cb65b7 + c69e31d commit ba37231
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions conf/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var Config = struct {
SENTRY struct {
DNS string
}
VERBOSE string
}{}

func init() {
Expand Down
5 changes: 4 additions & 1 deletion webActions/webaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package webActions

import (
"encoding/json"
"hatch-mcs/conf"
"net/http"

"github.com/getsentry/raven-go"
Expand All @@ -12,7 +13,9 @@ import (
func ResponseWithJSON(w http.ResponseWriter, r *http.Request, data interface{}, code int) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(code)
sm.Info(getUlrForLog(r), data)
if conf.Config.VERBOSE == "true" {
sm.Info(getUlrForLog(r), data)
}
result, _ := json.Marshal(data)
w.Write(result)
}
Expand Down

0 comments on commit ba37231

Please sign in to comment.