28 lines
718 B
Go
28 lines
718 B
Go
package processor
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
|
|
logger "git.site.quack-lab.dev/dave/cylogger"
|
|
)
|
|
|
|
func init() {
|
|
// Only modify logger in test mode
|
|
// This checks if we're running under 'go test'
|
|
if os.Getenv("GO_TESTING") == "1" || os.Getenv("TESTING") == "1" {
|
|
// Initialize logger with ERROR level for tests
|
|
// to minimize noise in test output
|
|
logger.Init(logger.LevelError)
|
|
|
|
// Optionally redirect logger output to discard
|
|
// This prevents logger output from interfering with test output
|
|
disableTestLogs := os.Getenv("ENABLE_TEST_LOGS") != "1"
|
|
if disableTestLogs {
|
|
// Create a new logger that writes to nowhere
|
|
silentLogger := logger.New(io.Discard, "", 0)
|
|
logger.Default = silentLogger
|
|
}
|
|
}
|
|
}
|