Move comments arount for cleaner godoc
Tim Hockin
3 years ago
13 | 13 | limitations under the License. |
14 | 14 | */ |
15 | 15 | |
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 | ||
16 | 22 | // Package logr defines abstract interfaces for logging. Packages can depend on |
17 | 23 | // these interfaces and callers can implement logging in whatever way is |
18 | 24 | // 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. | |
28 | 25 | // |
29 | 26 | // Usage |
30 | 27 | // |
113 | 110 | // generally best to avoid using the following keys, as they're frequently used |
114 | 111 | // by implementations: |
115 | 112 | // |
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. | |
124 | 121 | // |
125 | 122 | // Implementations are encouraged to make use of these keys to represent the |
126 | 123 | // above concepts, when necessary (for example, in a pure-JSON output form, it |
189 | 186 | WithName(name string) Logger |
190 | 187 | } |
191 | 188 | |
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 | // | |
193 | 192 | // Deprecated: use Logger instead. This will be removed in a future release. |
194 | 193 | type InfoLogger = Logger |
195 | 194 |