aboutsummaryrefslogtreecommitdiffstats
path: root/log/root.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-21 00:05:15 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-23 18:00:03 +0800
commitb9d48b4a9300b948362787b90cf3fb7ae77636b4 (patch)
tree9ed9d16374bd6c7f2cadd0a193e16fc5bc5c9ee3 /log/root.go
parentec7f81f4bc11c6f8203ec1d3055c9a09a244ff43 (diff)
downloadgo-tangerine-b9d48b4a9300b948362787b90cf3fb7ae77636b4.tar
go-tangerine-b9d48b4a9300b948362787b90cf3fb7ae77636b4.tar.gz
go-tangerine-b9d48b4a9300b948362787b90cf3fb7ae77636b4.tar.bz2
go-tangerine-b9d48b4a9300b948362787b90cf3fb7ae77636b4.tar.lz
go-tangerine-b9d48b4a9300b948362787b90cf3fb7ae77636b4.tar.xz
go-tangerine-b9d48b4a9300b948362787b90cf3fb7ae77636b4.tar.zst
go-tangerine-b9d48b4a9300b948362787b90cf3fb7ae77636b4.zip
log: add support for trace level, exit on critical
Diffstat (limited to 'log/root.go')
-rw-r--r--log/root.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/log/root.go b/log/root.go
index 39b4c9429..6814cc273 100644
--- a/log/root.go
+++ b/log/root.go
@@ -41,6 +41,11 @@ func Root() Logger {
// etc.) to keep the call depth the same for all paths to logger.write so
// runtime.Caller(2) always refers to the call site in client code.
+// Trace is a convenient alias for Root().Trace
+func Trace(msg string, ctx ...interface{}) {
+ root.write(msg, LvlTrace, ctx)
+}
+
// Debug is a convenient alias for Root().Debug
func Debug(msg string, ctx ...interface{}) {
root.write(msg, LvlDebug, ctx)
@@ -64,4 +69,5 @@ func Error(msg string, ctx ...interface{}) {
// Crit is a convenient alias for Root().Crit
func Crit(msg string, ctx ...interface{}) {
root.write(msg, LvlCrit, ctx)
+ os.Exit(1)
}