logger.go 407 B

12345678910111213141516171819
  1. // Copyright 2020 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package dbutil
  5. import (
  6. "fmt"
  7. "io"
  8. )
  9. // Logger is a wrapper of io.Writer for the GORM's logger.Writer.
  10. type Logger struct {
  11. io.Writer
  12. }
  13. func (l *Logger) Printf(format string, args ...any) {
  14. _, _ = fmt.Fprintf(l.Writer, format, args...)
  15. }