@@ -167,7 +167,13 @@ func (l *Logger) Debug(msg string, args ...any) {
167
167
l .log (nil , LevelDebug , msg , args ... )
168
168
}
169
169
170
+ // DebugContext logs at LevelDebug with the given context.
171
+ func (l * Logger ) DebugContext (ctx context.Context , msg string , args ... any ) {
172
+ l .log (ctx , LevelDebug , msg , args ... )
173
+ }
174
+
170
175
// DebugCtx logs at LevelDebug with the given context.
176
+ // Deprecated: Use Logger.DebugContext.
171
177
func (l * Logger ) DebugCtx (ctx context.Context , msg string , args ... any ) {
172
178
l .log (ctx , LevelDebug , msg , args ... )
173
179
}
@@ -177,7 +183,13 @@ func (l *Logger) Info(msg string, args ...any) {
177
183
l .log (nil , LevelInfo , msg , args ... )
178
184
}
179
185
186
+ // InfoContext logs at LevelInfo with the given context.
187
+ func (l * Logger ) InfoContext (ctx context.Context , msg string , args ... any ) {
188
+ l .log (ctx , LevelInfo , msg , args ... )
189
+ }
190
+
180
191
// InfoCtx logs at LevelInfo with the given context.
192
+ // Deprecated: Use Logger.InfoContext.
181
193
func (l * Logger ) InfoCtx (ctx context.Context , msg string , args ... any ) {
182
194
l .log (ctx , LevelInfo , msg , args ... )
183
195
}
@@ -187,7 +199,13 @@ func (l *Logger) Warn(msg string, args ...any) {
187
199
l .log (nil , LevelWarn , msg , args ... )
188
200
}
189
201
202
+ // WarnContext logs at LevelWarn with the given context.
203
+ func (l * Logger ) WarnContext (ctx context.Context , msg string , args ... any ) {
204
+ l .log (ctx , LevelWarn , msg , args ... )
205
+ }
206
+
190
207
// WarnCtx logs at LevelWarn with the given context.
208
+ // Deprecated: Use Logger.WarnContext.
191
209
func (l * Logger ) WarnCtx (ctx context.Context , msg string , args ... any ) {
192
210
l .log (ctx , LevelWarn , msg , args ... )
193
211
}
@@ -197,7 +215,13 @@ func (l *Logger) Error(msg string, args ...any) {
197
215
l .log (nil , LevelError , msg , args ... )
198
216
}
199
217
218
+ // ErrorContext logs at LevelError with the given context.
219
+ func (l * Logger ) ErrorContext (ctx context.Context , msg string , args ... any ) {
220
+ l .log (ctx , LevelError , msg , args ... )
221
+ }
222
+
200
223
// ErrorCtx logs at LevelError with the given context.
224
+ // Deprecated: Use Logger.ErrorContext.
201
225
func (l * Logger ) ErrorCtx (ctx context.Context , msg string , args ... any ) {
202
226
l .log (ctx , LevelError , msg , args ... )
203
227
}
@@ -249,8 +273,8 @@ func Debug(msg string, args ...any) {
249
273
Default ().log (nil , LevelDebug , msg , args ... )
250
274
}
251
275
252
- // DebugCtx calls Logger.DebugCtx on the default logger.
253
- func DebugCtx (ctx context.Context , msg string , args ... any ) {
276
+ // DebugContext calls Logger.DebugContext on the default logger.
277
+ func DebugContext (ctx context.Context , msg string , args ... any ) {
254
278
Default ().log (ctx , LevelDebug , msg , args ... )
255
279
}
256
280
@@ -259,8 +283,8 @@ func Info(msg string, args ...any) {
259
283
Default ().log (nil , LevelInfo , msg , args ... )
260
284
}
261
285
262
- // InfoCtx calls Logger.InfoCtx on the default logger.
263
- func InfoCtx (ctx context.Context , msg string , args ... any ) {
286
+ // InfoContext calls Logger.InfoContext on the default logger.
287
+ func InfoContext (ctx context.Context , msg string , args ... any ) {
264
288
Default ().log (ctx , LevelInfo , msg , args ... )
265
289
}
266
290
@@ -269,8 +293,8 @@ func Warn(msg string, args ...any) {
269
293
Default ().log (nil , LevelWarn , msg , args ... )
270
294
}
271
295
272
- // WarnCtx calls Logger.WarnCtx on the default logger.
273
- func WarnCtx (ctx context.Context , msg string , args ... any ) {
296
+ // WarnContext calls Logger.WarnContext on the default logger.
297
+ func WarnContext (ctx context.Context , msg string , args ... any ) {
274
298
Default ().log (ctx , LevelWarn , msg , args ... )
275
299
}
276
300
@@ -279,7 +303,31 @@ func Error(msg string, args ...any) {
279
303
Default ().log (nil , LevelError , msg , args ... )
280
304
}
281
305
282
- // ErrorCtx calls Logger.ErrorCtx on the default logger.
306
+ // ErrorContext calls Logger.ErrorContext on the default logger.
307
+ func ErrorContext (ctx context.Context , msg string , args ... any ) {
308
+ Default ().log (ctx , LevelError , msg , args ... )
309
+ }
310
+
311
+ // DebugCtx calls Logger.DebugContext on the default logger.
312
+ // Deprecated: call DebugContext.
313
+ func DebugCtx (ctx context.Context , msg string , args ... any ) {
314
+ Default ().log (ctx , LevelDebug , msg , args ... )
315
+ }
316
+
317
+ // InfoCtx calls Logger.InfoContext on the default logger.
318
+ // Deprecated: call InfoContext.
319
+ func InfoCtx (ctx context.Context , msg string , args ... any ) {
320
+ Default ().log (ctx , LevelInfo , msg , args ... )
321
+ }
322
+
323
+ // WarnCtx calls Logger.WarnContext on the default logger.
324
+ // Deprecated: call WarnContext.
325
+ func WarnCtx (ctx context.Context , msg string , args ... any ) {
326
+ Default ().log (ctx , LevelWarn , msg , args ... )
327
+ }
328
+
329
+ // ErrorCtx calls Logger.ErrorContext on the default logger.
330
+ // Deprecated: call ErrorContext.
283
331
func ErrorCtx (ctx context.Context , msg string , args ... any ) {
284
332
Default ().log (ctx , LevelError , msg , args ... )
285
333
}
0 commit comments