Refactor profiler startup / logging

This commit is contained in:
Jakob Borg 2014-03-09 09:18:28 +01:00
parent 2553ba0463
commit 9ec7de643e
2 changed files with 2 additions and 12 deletions

View File

@ -13,16 +13,6 @@ func init() {
logger = log.New(os.Stderr, "", log.Flags())
}
func debugln(vals ...interface{}) {
s := fmt.Sprintln(vals...)
logger.Output(2, "DEBUG: "+s)
}
func debugf(format string, vals ...interface{}) {
s := fmt.Sprintf(format, vals...)
logger.Output(2, "DEBUG: "+s)
}
func infoln(vals ...interface{}) {
s := fmt.Sprintln(vals...)
logger.Output(2, "INFO: "+s)

View File

@ -167,10 +167,10 @@ func main() {
if profiler := os.Getenv("STPROFILER"); len(profiler) > 0 {
go func() {
debugln("Starting profiler on", profiler)
dlog.Println("Starting profiler on", profiler)
err := http.ListenAndServe(profiler, nil)
if err != nil {
warnln(err)
dlog.Fatal(err)
}
}()
}