add lint action (#19)
All checks were successful
Go Action / goaction (push) Successful in 19m15s
All checks were successful
Go Action / goaction (push) Successful in 19m15s
Reviewed-on: #19
This commit was merged in pull request #19.
This commit is contained in:
68
global.go
68
global.go
@@ -9,7 +9,7 @@ import (
|
||||
"gitoa.ru/go-4devs/log/level"
|
||||
)
|
||||
|
||||
//nolint:gochecknoglobals,gomnd
|
||||
//nolint:gochecknoglobals
|
||||
var global = With(New(),
|
||||
WithTime(KeyTime, time.RFC3339),
|
||||
WithLevel(KeyLevel, level.Debug),
|
||||
@@ -28,112 +28,112 @@ func Log() Logger {
|
||||
}
|
||||
|
||||
// Emerg log by emergency level.
|
||||
func Emerg(ctx context.Context, args ...interface{}) {
|
||||
func Emerg(ctx context.Context, args ...any) {
|
||||
global.Emerg(ctx, args...)
|
||||
}
|
||||
|
||||
// Alert log by alert level.
|
||||
func Alert(ctx context.Context, args ...interface{}) {
|
||||
func Alert(ctx context.Context, args ...any) {
|
||||
global.Alert(ctx, args...)
|
||||
}
|
||||
|
||||
// Crit log by critical level.
|
||||
func Crit(ctx context.Context, args ...interface{}) {
|
||||
func Crit(ctx context.Context, args ...any) {
|
||||
global.Crit(ctx, args...)
|
||||
}
|
||||
|
||||
// Err log by error level.
|
||||
func Err(ctx context.Context, args ...interface{}) {
|
||||
func Err(ctx context.Context, args ...any) {
|
||||
global.Err(ctx, args...)
|
||||
}
|
||||
|
||||
// Warn logs by warning level.
|
||||
func Warn(ctx context.Context, args ...interface{}) {
|
||||
func Warn(ctx context.Context, args ...any) {
|
||||
global.Warn(ctx, args...)
|
||||
}
|
||||
|
||||
// Notice log by notice level.
|
||||
func Notice(ctx context.Context, args ...interface{}) {
|
||||
func Notice(ctx context.Context, args ...any) {
|
||||
global.Notice(ctx, args...)
|
||||
}
|
||||
|
||||
// Info log by info level.
|
||||
func Info(ctx context.Context, args ...interface{}) {
|
||||
func Info(ctx context.Context, args ...any) {
|
||||
global.Info(ctx, args...)
|
||||
}
|
||||
|
||||
// Debug log by debug level.
|
||||
func Debug(ctx context.Context, args ...interface{}) {
|
||||
func Debug(ctx context.Context, args ...any) {
|
||||
global.Debug(ctx, args...)
|
||||
}
|
||||
|
||||
// Print log by info level and arguments.
|
||||
func Print(args ...interface{}) {
|
||||
func Print(args ...any) {
|
||||
global.Print(args...)
|
||||
}
|
||||
|
||||
// Fatal log by alert level and arguments.
|
||||
func Fatal(args ...interface{}) {
|
||||
func Fatal(args ...any) {
|
||||
global.Fatal(args...)
|
||||
}
|
||||
|
||||
// Panic log by emergency level and arguments.
|
||||
func Panic(args ...interface{}) {
|
||||
func Panic(args ...any) {
|
||||
global.Panic(args...)
|
||||
}
|
||||
|
||||
// Println log by info level and arguments.
|
||||
func Println(args ...interface{}) {
|
||||
func Println(args ...any) {
|
||||
global.Println(args...)
|
||||
}
|
||||
|
||||
// Fatalln log by alert level and arguments.
|
||||
func Fatalln(args ...interface{}) {
|
||||
func Fatalln(args ...any) {
|
||||
global.Fatalln(args...)
|
||||
}
|
||||
|
||||
// Panicln log by emergency level and arguments.
|
||||
func Panicln(args ...interface{}) {
|
||||
func Panicln(args ...any) {
|
||||
global.Panicln(args...)
|
||||
}
|
||||
|
||||
// EmergKVs sugared log by emergency level and key-values.
|
||||
func EmergKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func EmergKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.EmergKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
// AlertKVs sugared log by alert level and key-values.
|
||||
func AlertKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func AlertKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.AlertKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
// CritKVs sugared log by critcal level and key-values.
|
||||
func CritKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func CritKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.CritKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
// ErrKVs sugared log by error level and key-values.
|
||||
func ErrKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func ErrKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.ErrKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
// WarnKVs sugared log by warning level and key-values.
|
||||
func WarnKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func WarnKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.WarnKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
// NoticeKVs sugared log by notice level and key-values.
|
||||
func NoticeKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func NoticeKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.NoticeKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
// InfoKVs sugared log by info level and key-values.
|
||||
func InfoKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func InfoKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.InfoKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
// DebugKVs sugared log by debug level and key-values.
|
||||
func DebugKVs(ctx context.Context, msg string, args ...interface{}) {
|
||||
func DebugKVs(ctx context.Context, msg string, args ...any) {
|
||||
global.DebugKVs(ctx, msg, args...)
|
||||
}
|
||||
|
||||
@@ -178,57 +178,57 @@ func DebugKV(ctx context.Context, msg string, args ...field.Field) {
|
||||
}
|
||||
|
||||
// Emergf log by emergency level by format and arguments.
|
||||
func Emergf(ctx context.Context, format string, args ...interface{}) {
|
||||
func Emergf(ctx context.Context, format string, args ...any) {
|
||||
global.Emergf(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Alertf log by alert level by format and arguments.
|
||||
func Alertf(ctx context.Context, format string, args ...interface{}) {
|
||||
func Alertf(ctx context.Context, format string, args ...any) {
|
||||
global.Alertf(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Critf log by critical level by format and arguments.
|
||||
func Critf(ctx context.Context, format string, args ...interface{}) {
|
||||
func Critf(ctx context.Context, format string, args ...any) {
|
||||
global.Critf(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Errf log by error level by format and arguments.
|
||||
func Errf(ctx context.Context, format string, args ...interface{}) {
|
||||
func Errf(ctx context.Context, format string, args ...any) {
|
||||
global.Errf(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Warnf log by warning level by format and arguments.
|
||||
func Warnf(ctx context.Context, format string, args ...interface{}) {
|
||||
func Warnf(ctx context.Context, format string, args ...any) {
|
||||
global.Warnf(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Noticef log by notice level by format and arguments.
|
||||
func Noticef(ctx context.Context, format string, args ...interface{}) {
|
||||
func Noticef(ctx context.Context, format string, args ...any) {
|
||||
global.Noticef(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Infof log by info level by format and arguments.
|
||||
func Infof(ctx context.Context, format string, args ...interface{}) {
|
||||
func Infof(ctx context.Context, format string, args ...any) {
|
||||
global.Noticef(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Debugf log by debug level by format and arguments.
|
||||
func Debugf(ctx context.Context, format string, args ...interface{}) {
|
||||
func Debugf(ctx context.Context, format string, args ...any) {
|
||||
global.Debugf(ctx, format, args...)
|
||||
}
|
||||
|
||||
// Printf log by info level by format and arguments without context.
|
||||
func Printf(format string, args ...interface{}) {
|
||||
func Printf(format string, args ...any) {
|
||||
global.Printf(format, args...)
|
||||
}
|
||||
|
||||
// Fatalf log by alert level by format and arguments without context.
|
||||
func Fatalf(format string, args ...interface{}) {
|
||||
func Fatalf(format string, args ...any) {
|
||||
global.Fatalf(format, args...)
|
||||
}
|
||||
|
||||
// Panicf log by emergency level and arguments without context.
|
||||
func Panicf(format string, args ...interface{}) {
|
||||
func Panicf(format string, args ...any) {
|
||||
global.Panicf(format, args...)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user