Codebase list golang-github-go-logr-logr / 4eabc2e
Move comments arount for cleaner godoc Tim Hockin 3 years ago
1 changed file(s) with 17 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
1313 limitations under the License.
1414 */
1515
16 // This design derives from Dave Cheney's blog:
17 // http://dave.cheney.net/2015/11/05/lets-talk-about-logging
18 //
19 // This is a BETA grade API. Until there is a significant 2nd implementation,
20 // I don't really know how it will change.
21
1622 // Package logr defines abstract interfaces for logging. Packages can depend on
1723 // these interfaces and callers can implement logging in whatever way is
1824 // appropriate.
19 //
20 // This design derives from Dave Cheney's blog:
21 // http://dave.cheney.net/2015/11/05/lets-talk-about-logging
22 //
23 // This is a BETA grade API. Until there is a significant 2nd implementation,
24 // I don't really know how it will change.
25 //
26 // The logging specifically makes it non-trivial to use format strings, to encourage
27 // attaching structured information instead of unstructured format strings.
2825 //
2926 // Usage
3027 //
113110 // generally best to avoid using the following keys, as they're frequently used
114111 // by implementations:
115112 //
116 // - `"caller"`: the calling information (file/line) of a particular log line.
117 // - `"error"`: the underlying error value in the `Error` method.
118 // - `"level"`: the log level.
119 // - `"logger"`: the name of the associated logger.
120 // - `"msg"`: the log message.
121 // - `"stacktrace"`: the stack trace associated with a particular log line or
122 // error (often from the `Error` message).
123 // - `"ts"`: the timestamp for a log line.
113 // * `"caller"`: the calling information (file/line) of a particular log line.
114 // * `"error"`: the underlying error value in the `Error` method.
115 // * `"level"`: the log level.
116 // * `"logger"`: the name of the associated logger.
117 // * `"msg"`: the log message.
118 // * `"stacktrace"`: the stack trace associated with a particular log line or
119 // error (often from the `Error` message).
120 // * `"ts"`: the timestamp for a log line.
124121 //
125122 // Implementations are encouraged to make use of these keys to represent the
126123 // above concepts, when necessary (for example, in a pure-JSON output form, it
189186 WithName(name string) Logger
190187 }
191188
192 // InfoLogger provides compatibility with code that relies on the v0.1.0 interface
189 // InfoLogger provides compatibility with code that relies on the v0.1.0
190 // interface.
191 //
193192 // Deprecated: use Logger instead. This will be removed in a future release.
194193 type InfoLogger = Logger
195194