Skip to content

Commit

Permalink
allow JIRA_LOG_FORMAT env variable to control log output format
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed Aug 3, 2016
1 parent 752a94d commit 469def0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ import (

var (
log = logging.MustGetLogger("jira")
format = "%{color}%{time:2006-01-02T15:04:05.000Z07:00} %{level:-5s} [%{shortfile}]%{color:reset} %{message}"
defaultFormat = "%{color}%{time:2006-01-02T15:04:05.000Z07:00} %{level:-5s} [%{shortfile}]%{color:reset} %{message}"
)

func main() {
logBackend := logging.NewLogBackend(os.Stderr, "", 0)
format := os.Getenv("JIRA_LOG_FORMAT")
if format == "" {
format = defaultFormat
}
logging.SetBackend(
logging.NewBackendFormatter(
logBackend,
Expand Down

0 comments on commit 469def0

Please sign in to comment.