mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 23:39:08 +00:00
* Update log for passing attrs with context. * Check type-casting * add tests. * Use t.Cleanup() to restore the global value. * Fix error. * Update tests. * Add comments. * Remove cover.cov * Update doc. * Update git ignore.
26 lines
590 B
Go
26 lines
590 B
Go
package log
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// Debug logs debug messages.
|
|
func Debug(ctx context.Context, msg string, args ...any) {
|
|
getLogger(ctx).DebugContext(ctx, msg, args...)
|
|
}
|
|
|
|
// Info logs info messages.
|
|
func Info(ctx context.Context, msg string, args ...any) {
|
|
getLogger(ctx).InfoContext(ctx, msg, args...)
|
|
}
|
|
|
|
// Warn logs warning messages.
|
|
func Warn(ctx context.Context, msg string, args ...any) {
|
|
getLogger(ctx).WarnContext(ctx, msg, args...)
|
|
}
|
|
|
|
// Error logs error messages.
|
|
func Error(ctx context.Context, msg string, args ...any) {
|
|
getLogger(ctx).ErrorContext(ctx, msg, args...)
|
|
}
|