github.com/wfusion/gofusion@v1.1.14/common/infra/metrics/log.go (about)

     1  package metrics
     2  
     3  import "log"
     4  
     5  // Logger supports logging at various log levels.
     6  type Logger interface {
     7  	// Debug logs a message at Debug level.
     8  	Debug(args ...any)
     9  
    10  	// Info logs a message at Info level.
    11  	Info(args ...any)
    12  
    13  	// Warn logs a message at Warning level.
    14  	Warn(args ...any)
    15  
    16  	// Error logs a message at Error level.
    17  	Error(args ...any)
    18  
    19  	// Fatal logs a message at Fatal level
    20  	// and process will exit with status set to 1.
    21  	Fatal(args ...any)
    22  }
    23  
    24  type defaultLogger struct{}
    25  
    26  func (d *defaultLogger) Debug(args ...any) {
    27  	log.Println(args...)
    28  }
    29  func (d *defaultLogger) Info(args ...any) {
    30  	log.Println(args...)
    31  }
    32  func (d *defaultLogger) Warn(args ...any) {
    33  	log.Println(args...)
    34  }
    35  func (d *defaultLogger) Error(args ...any) {
    36  	log.Println(args...)
    37  }
    38  func (d *defaultLogger) Fatal(args ...any) {
    39  	log.Fatalln(args...)
    40  }