log: automatically add 2 (skipLevel) to the step in log.Output

This commit is contained in:
Anton Evangelatov 2018-06-08 15:35:56 +03:00
parent c7799560cf
commit d8b75b445a

View file

@ -60,7 +60,8 @@ func Crit(msg string, ctx ...interface{}) {
os.Exit(1) os.Exit(1)
} }
// Output is a convenient alias for write // Output is a convenient alias for write, allowing for the modification of
// the skip step (number of stack frames to skip)
func Output(msg string, lvl Lvl, skip int, ctx ...interface{}) { func Output(msg string, lvl Lvl, skip int, ctx ...interface{}) {
root.write(msg, lvl, ctx, skip) root.write(msg, lvl, ctx, skip+skipLevel)
} }