50 lines
1.1 KiB
Go
50 lines
1.1 KiB
Go
package logger
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
/**
|
|
* @Author linya.jj
|
|
* @Date 2023/3/22 14:32
|
|
*/
|
|
|
|
// This logger is only for debug. Do not use it online.
|
|
type StdTestLogger struct {
|
|
}
|
|
|
|
func NewStdTestLogger() *StdTestLogger {
|
|
return &StdTestLogger{}
|
|
}
|
|
|
|
func (l *StdTestLogger) Debugf(format string, args ...interface{}) {
|
|
fmt.Printf("%s [Debug] ", time.Now().String())
|
|
fmt.Printf(format, args...)
|
|
fmt.Print("\n")
|
|
}
|
|
|
|
func (l *StdTestLogger) Infof(format string, args ...interface{}) {
|
|
fmt.Printf("%s [INFO] ", time.Now().String())
|
|
fmt.Printf(format, args...)
|
|
fmt.Print("\n")
|
|
}
|
|
|
|
func (l *StdTestLogger) Warningf(format string, args ...interface{}) {
|
|
fmt.Printf("%s [WARNING] ", time.Now().String())
|
|
fmt.Printf(format, args...)
|
|
fmt.Print("\n")
|
|
}
|
|
|
|
func (l *StdTestLogger) Errorf(format string, args ...interface{}) {
|
|
fmt.Printf("%s [ERROR] ", time.Now().String())
|
|
fmt.Printf(format, args...)
|
|
fmt.Print("\n")
|
|
}
|
|
|
|
func (l *StdTestLogger) Fatalf(format string, args ...interface{}) {
|
|
fmt.Printf("%s [FATAL] ", time.Now().String())
|
|
fmt.Printf(format, args...)
|
|
fmt.Print("\n")
|
|
}
|