Files
dbbackup/internal/logger/null.go
Renz 95ea807d18 Quality improvements: Remove dead code, add unit tests, fix ignored errors
HIGH PRIORITY FIXES:
1. Remove unused progressCallback mechanism (dead code cleanup)
2. Add unit tests for restore package (formats, safety checks)
   - Test coverage for archive format detection
   - Test coverage for safety validation
   - Added NullLogger for testing
3. Fix ignored errors in backup pipeline
   - Handle StdoutPipe() errors properly
   - Log stderr pipe errors
   - Document CPU detection errors

IMPROVEMENTS:
- formats_test.go: 8 test functions, all passing
- safety_test.go: 6 test functions for validation
- logger/null.go: Test helper for unit tests
- Proper error handling in streaming compression
- Fixed indentation in stderr handling
2025-11-07 11:47:07 +00:00

26 lines
800 B
Go

package logger
// NullLogger is a logger that discards all output (useful for testing)
type NullLogger struct{}
// NewNullLogger creates a new null logger
func NewNullLogger() *NullLogger {
return &NullLogger{}
}
func (l *NullLogger) Info(msg string, args ...any) {}
func (l *NullLogger) Warn(msg string, args ...any) {}
func (l *NullLogger) Error(msg string, args ...any) {}
func (l *NullLogger) Debug(msg string, args ...any) {}
func (l *NullLogger) Time(msg string, args ...any) {}
func (l *NullLogger) StartOperation(name string) OperationLogger {
return &nullOperation{}
}
type nullOperation struct{}
func (o *nullOperation) Update(msg string, args ...any) {}
func (o *nullOperation) Complete(msg string, args ...any) {}
func (o *nullOperation) Fail(msg string, args ...any) {}