diff --git a/log/logger.go b/log/logger.go index cf35360..4a63899 100644 --- a/log/logger.go +++ b/log/logger.go @@ -2,14 +2,13 @@ package log // Logger is a logging interface with only the essentials that a function that needs to log should care about. Compatible with standard Go logger. type Logger interface { - Print(v ...interface{}) - Printf(format string, v ...interface{}) - Println(v ...interface{}) + Fatal(v ...any) + Fatalf(format string, v ...any) + Fatalln(v ...any) + Panic(v ...any) + Panicf(format string, v ...any) + Panicln(v ...any) + Print(v ...any) + Printf(format string, v ...any) + Println(v ...any) } - -// None provides a logger that doesnt log anything -type None struct{} - -func (n None) Print(v ...interface{}) {} -func (n None) Printf(format string, v ...interface{}) {} -func (n None) Println(v ...interface{}) {} diff --git a/log/none.go b/log/none.go new file mode 100644 index 0000000..3a3880b --- /dev/null +++ b/log/none.go @@ -0,0 +1,14 @@ +package log + +// None provides a logger that doesnt log anything +type None struct{} + +func (n None) Fatal(v ...any) {} +func (n None) Fatalf(format string, v ...any) {} +func (n None) Fatalln(v ...any) {} +func (n None) Panic(v ...any) {} +func (n None) Panicf(format string, v ...any) {} +func (n None) Panicln(v ...any) {} +func (n None) Print(v ...any) {} +func (n None) Printf(format string, v ...any) {} +func (n None) Println(v ...any) {}