coreos / capnslog

DEPRECATED: The CoreOS logging package
Apache License 2.0
11 stars 10 forks source link

pkg_logger.go: - introduce logf internal methods which is adding #2

Open mk01 opened 4 years ago

mk01 commented 4 years ago
            +1 on call depth pointer

pkg_logger.go: - make logging functions with variadic parameters call new logf (including Logf) formatters.go: - change const depth of 5 to calculated in LogFormatter hello_dolly.go: - add Error()/Errorf() calls via GlogFormatter and LogFormatter to show we can mimic original Glog output format or integrate "log" pkg, and that the call depth is properly balanced when calling Formatter.Format() method

Variadic variants of logging functions initially wrapped Logf(), while the others called internalLog() directly. This was making the caller's stack depth uneven between the various calls which as a result was making runtime.Caller() returning not correct line/file (in the already present Formatter implementations or custom ones).

bgilbert commented 2 years ago

This repo was an attempt to split capnslog out of github.com/coreos/pkg. We're giving up on that and archiving this repository. If you'd like, you can reopen your PR against coreos/pkg.