Create setupTestLogger() helper to reduce duplicate logger initialization in test files. Replace 20+ occurrences of logging.NewAppLogger calls. - Create testutil.go with setupTestLogger() function - Update app_test.go to use the new helper - Remove unused logging import from app_test.go Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
15 lines
351 B
Go
15 lines
351 B
Go
//go:build !windows
|
||
|
||
package app
|
||
|
||
import (
|
||
"rua.plus/lolly/internal/config"
|
||
"rua.plus/lolly/internal/logging"
|
||
)
|
||
|
||
// setupTestLogger 创建一个测试用的日志记录器。
|
||
// 返回一个使用默认配置的 AppLogger,适用于测试场景。
|
||
func setupTestLogger() *logging.AppLogger {
|
||
return logging.NewAppLogger(&config.LoggingConfig{})
|
||
}
|