Commit dbbe28b
committed
log: define G() as a function instead of a variable
The `G` variable is exported, and not expected to be overwritten
externally. Defining it as a function also documents it as a function
on https://pkg.go.dev, instead of a variable; https://pkg.go.dev/github.com/containerd/[email protected]/log#pkg-variables
Note that (while the godoc suggests otherwise) I made `GetLogger` an alias
for `G`, as `G` is the most commonly used function (not the other way round),
although I don't think there's a performance gain in doing so.
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 778ac30)
Signed-off-by: Sebastiaan van Stijn <[email protected]>1 parent 93b6cb7 commit dbbe28b
1 file changed
+9
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 26 | + | |
| 27 | + | |
36 | 28 | | |
37 | 29 | | |
38 | 30 | | |
| |||
141 | 133 | | |
142 | 134 | | |
143 | 135 | | |
144 | | - | |
| 136 | + | |
| 137 | + | |
145 | 138 | | |
146 | | - | |
147 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
148 | 143 | | |
149 | | - | |
150 | | - | |
| 144 | + | |
151 | 145 | | |
0 commit comments