48 lines
		
	
	
		
			882 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			882 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package logutils
 | |
| 
 | |
| import (
 | |
| 	"github.com/stretchr/testify/mock"
 | |
| )
 | |
| 
 | |
| type MockLog struct {
 | |
| 	mock.Mock
 | |
| }
 | |
| 
 | |
| func NewMockLog() *MockLog {
 | |
| 	return &MockLog{}
 | |
| }
 | |
| 
 | |
| func (m *MockLog) Fatalf(format string, args ...any) {
 | |
| 	mArgs := []any{format}
 | |
| 	m.Called(append(mArgs, args...)...)
 | |
| }
 | |
| 
 | |
| func (m *MockLog) Panicf(format string, args ...any) {
 | |
| 	mArgs := []any{format}
 | |
| 	m.Called(append(mArgs, args...)...)
 | |
| }
 | |
| 
 | |
| func (m *MockLog) Errorf(format string, args ...any) {
 | |
| 	mArgs := []any{format}
 | |
| 	m.Called(append(mArgs, args...)...)
 | |
| }
 | |
| 
 | |
| func (m *MockLog) Warnf(format string, args ...any) {
 | |
| 	mArgs := []any{format}
 | |
| 	m.Called(append(mArgs, args...)...)
 | |
| }
 | |
| 
 | |
| func (m *MockLog) Infof(format string, args ...any) {
 | |
| 	mArgs := []any{format}
 | |
| 	m.Called(append(mArgs, args...)...)
 | |
| }
 | |
| 
 | |
| func (m *MockLog) Child(name string) Log {
 | |
| 	m.Called(name)
 | |
| 	return m
 | |
| }
 | |
| 
 | |
| func (m *MockLog) SetLevel(level LogLevel) {
 | |
| 	m.Called(level)
 | |
| }
 | 
