github.com/binyushen/fabric@v2.1.1+incompatible/core/operations/fakes/logger.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/hyperledger/fabric/core/operations"
     8  )
     9  
    10  type Logger struct {
    11  	WarnStub        func(...interface{})
    12  	warnMutex       sync.RWMutex
    13  	warnArgsForCall []struct {
    14  		arg1 []interface{}
    15  	}
    16  	WarnfStub        func(string, ...interface{})
    17  	warnfMutex       sync.RWMutex
    18  	warnfArgsForCall []struct {
    19  		arg1 string
    20  		arg2 []interface{}
    21  	}
    22  	invocations      map[string][][]interface{}
    23  	invocationsMutex sync.RWMutex
    24  }
    25  
    26  func (fake *Logger) Warn(arg1 ...interface{}) {
    27  	fake.warnMutex.Lock()
    28  	fake.warnArgsForCall = append(fake.warnArgsForCall, struct {
    29  		arg1 []interface{}
    30  	}{arg1})
    31  	fake.recordInvocation("Warn", []interface{}{arg1})
    32  	fake.warnMutex.Unlock()
    33  	if fake.WarnStub != nil {
    34  		fake.WarnStub(arg1...)
    35  	}
    36  }
    37  
    38  func (fake *Logger) WarnCallCount() int {
    39  	fake.warnMutex.RLock()
    40  	defer fake.warnMutex.RUnlock()
    41  	return len(fake.warnArgsForCall)
    42  }
    43  
    44  func (fake *Logger) WarnCalls(stub func(...interface{})) {
    45  	fake.warnMutex.Lock()
    46  	defer fake.warnMutex.Unlock()
    47  	fake.WarnStub = stub
    48  }
    49  
    50  func (fake *Logger) WarnArgsForCall(i int) []interface{} {
    51  	fake.warnMutex.RLock()
    52  	defer fake.warnMutex.RUnlock()
    53  	argsForCall := fake.warnArgsForCall[i]
    54  	return argsForCall.arg1
    55  }
    56  
    57  func (fake *Logger) Warnf(arg1 string, arg2 ...interface{}) {
    58  	fake.warnfMutex.Lock()
    59  	fake.warnfArgsForCall = append(fake.warnfArgsForCall, struct {
    60  		arg1 string
    61  		arg2 []interface{}
    62  	}{arg1, arg2})
    63  	fake.recordInvocation("Warnf", []interface{}{arg1, arg2})
    64  	fake.warnfMutex.Unlock()
    65  	if fake.WarnfStub != nil {
    66  		fake.WarnfStub(arg1, arg2...)
    67  	}
    68  }
    69  
    70  func (fake *Logger) WarnfCallCount() int {
    71  	fake.warnfMutex.RLock()
    72  	defer fake.warnfMutex.RUnlock()
    73  	return len(fake.warnfArgsForCall)
    74  }
    75  
    76  func (fake *Logger) WarnfCalls(stub func(string, ...interface{})) {
    77  	fake.warnfMutex.Lock()
    78  	defer fake.warnfMutex.Unlock()
    79  	fake.WarnfStub = stub
    80  }
    81  
    82  func (fake *Logger) WarnfArgsForCall(i int) (string, []interface{}) {
    83  	fake.warnfMutex.RLock()
    84  	defer fake.warnfMutex.RUnlock()
    85  	argsForCall := fake.warnfArgsForCall[i]
    86  	return argsForCall.arg1, argsForCall.arg2
    87  }
    88  
    89  func (fake *Logger) Invocations() map[string][][]interface{} {
    90  	fake.invocationsMutex.RLock()
    91  	defer fake.invocationsMutex.RUnlock()
    92  	fake.warnMutex.RLock()
    93  	defer fake.warnMutex.RUnlock()
    94  	fake.warnfMutex.RLock()
    95  	defer fake.warnfMutex.RUnlock()
    96  	copiedInvocations := map[string][][]interface{}{}
    97  	for key, value := range fake.invocations {
    98  		copiedInvocations[key] = value
    99  	}
   100  	return copiedInvocations
   101  }
   102  
   103  func (fake *Logger) recordInvocation(key string, args []interface{}) {
   104  	fake.invocationsMutex.Lock()
   105  	defer fake.invocationsMutex.Unlock()
   106  	if fake.invocations == nil {
   107  		fake.invocations = map[string][][]interface{}{}
   108  	}
   109  	if fake.invocations[key] == nil {
   110  		fake.invocations[key] = [][]interface{}{}
   111  	}
   112  	fake.invocations[key] = append(fake.invocations[key], args)
   113  }
   114  
   115  var _ operations.Logger = new(Logger)