fixup logging

parent 8dfc00a7
Pipeline #205 failed with stages
in 0 seconds
0.1.0: QmcwwSZ4fCjy8exboUmqCdVsX1r2ddDb9DHyA4pgnQvdwD 0.1.1: QmWTHakXvEmW44Muyy1wGGzoWA4tntuuvd8BhBbmLYBzSx
package metricsprometheus package metricsprometheus
import ( import (
"fmt"
"os"
"runtime/debug" "runtime/debug"
"strings" "strings"
...@@ -16,15 +14,14 @@ var log logging.EventLogger = logging.Logger("metrics-prometheus") ...@@ -16,15 +14,14 @@ var log logging.EventLogger = logging.Logger("metrics-prometheus")
func init() { func init() {
err := metrics.InjectImpl(newCreator) err := metrics.InjectImpl(newCreator)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, log.Errorf("Failed to inject go-metrics-prometheus into go-metrics-interface.")
"Failed to inject go-metrics-prometheus into go-metrics-interface.")
debug.PrintStack() debug.PrintStack()
} }
} }
func newCreator(name, helptext string) metrics.Creator { func newCreator(name, helptext string) metrics.Creator {
return &creator{ return &creator{
name: strings.Replace(helptext, ".", "_", -1), name: strings.Replace(name, ".", "_", -1),
helptext: helptext, helptext: helptext,
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"gxDependencies": [ "gxDependencies": [
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmdUib18JngJSGT4YhcG1J1wwMtNKGWzwnTEWowYuYCkwd", "hash": "QmR3KwhXCRLTNZB59vELb2HhEWrGy9nuychepxFtj3wWYa",
"name": "client_golang", "name": "client_golang",
"version": "0.1.0" "version": "0.1.0"
}, },
...@@ -19,11 +19,16 @@ ...@@ -19,11 +19,16 @@
"hash": "QmVWBQQAz4Cd2XgW9KgQoqXXrU8KJoCb9WCrhWRFVBKvFe", "hash": "QmVWBQQAz4Cd2XgW9KgQoqXXrU8KJoCb9WCrhWRFVBKvFe",
"name": "go-metrics-interface", "name": "go-metrics-interface",
"version": "0.1.1" "version": "0.1.1"
},
{
"hash": "QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52",
"name": "go-log",
"version": "1.2.0"
} }
], ],
"gxVersion": "0.9.0", "gxVersion": "0.9.0",
"language": "go", "language": "go",
"license": "MIT", "license": "MIT",
"name": "go-metrics-prometheus", "name": "go-metrics-prometheus",
"version": "0.1.0" "version": "0.1.1"
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment