mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-24 14:22:28 +00:00
added logger
This commit is contained in:
parent
b332c9e715
commit
489750a710
1 changed files with 13 additions and 0 deletions
13
webhook2.go
13
webhook2.go
|
@ -3,6 +3,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/codegangsta/negroni"
|
"github.com/codegangsta/negroni"
|
||||||
|
@ -19,9 +21,20 @@ var (
|
||||||
func init() {
|
func init() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
log.SetPrefix("[webhook] ")
|
||||||
|
log.SetFlags(log.Ldate | log.Ltime)
|
||||||
|
|
||||||
|
if !*verbose {
|
||||||
|
log.SetOutput(ioutil.Discard)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println("starting")
|
||||||
|
|
||||||
// load and parse hooks
|
// load and parse hooks
|
||||||
|
log.Printf("attempting to load hooks from %s\n", *hooksFilePath)
|
||||||
|
|
||||||
// set up file watcher
|
// set up file watcher
|
||||||
|
log.Printf("setting up file watcher for %s\n", *hooksFilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue