Skip to content

Commit

Permalink
feat: gorm的debug日志无论是否开启了zap都需要输出到控制台
Browse files Browse the repository at this point in the history
  • Loading branch information
piexlMax(奇淼 committed Dec 31, 2024
1 parent 21237f8 commit 1743c76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/initialize/internal/gorm_logger_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ func NewWriter(config config.GeneralDB) *Writer {

// Printf 格式化打印日志
func (c *Writer) Printf(message string, data ...any) {

// 当有日志时候均需要输出到控制台
fmt.Printf(message, data...)

// 当开启了zap的情况,会打印到日志记录
if c.config.LogZap {
switch c.config.LogLevel() {
case logger.Silent:
Expand Down

0 comments on commit 1743c76

Please sign in to comment.