Remove #rollbar
This commit is contained in:
parent
f32091c3cd
commit
44ad6bc802
|
@ -14,7 +14,6 @@ var (
|
|||
Storage string
|
||||
Env string
|
||||
Port int
|
||||
Rollbar string
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -22,7 +21,6 @@ func SetupConfig() {
|
|||
flag.StringVar(&Config.Storage, "storage", "-", "Kyoto Cabinet storage path (e.g. "+DefaultProductionStorage+")")
|
||||
flag.StringVar(&Config.Env, "environment", "development", "Process environment: development or production")
|
||||
flag.IntVar(&Config.Port, "port", 4401, "Server HTTP port")
|
||||
flag.StringVar(&Config.Rollbar, "rollbar", "", "Rollbar token")
|
||||
flag.Parse()
|
||||
|
||||
if Config.Env == "production" && Config.Storage == "-" {
|
||||
|
|
13
logging.go
13
logging.go
|
@ -1,7 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/stvp/rollbar"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
|
@ -13,18 +12,11 @@ var (
|
|||
|
||||
func SetupLogging() {
|
||||
logger = log.New(os.Stdout, "", log.Ldate|log.Lmicroseconds)
|
||||
rollbar.Token = Config.Rollbar
|
||||
rollbar.Environment = Config.Env
|
||||
|
||||
Log("Burlesque started in %s environment", Config.Env)
|
||||
Log("GOMAXPROCS is set to %d", runtime.GOMAXPROCS(-1))
|
||||
Log("Storage path: %s", Config.Storage)
|
||||
Log("Server is running at http://127.0.0.1:%d", Config.Port)
|
||||
if Config.Rollbar == "" {
|
||||
Log("Rollbar is not configured and disabled")
|
||||
} else {
|
||||
Log("Rollbar token: %s", Config.Rollbar)
|
||||
}
|
||||
}
|
||||
|
||||
func Log(format string, args ...interface{}) {
|
||||
|
@ -42,8 +34,7 @@ func Error(err error, format string, args ...interface{}) {
|
|||
|
||||
if Config.Env == "development" {
|
||||
panic(err)
|
||||
}
|
||||
if Config.Rollbar != "" {
|
||||
rollbar.Error("error", err)
|
||||
} else {
|
||||
logger.Printf(" ", err.Error())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue