dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/clients/logger/mock-logger.go (about)

     1  /*******************************************************************************
     2   * Copyright 2019 Dell Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
     5   * in compliance with the License. You may obtain a copy of the License at
     6   *
     7   * http://www.apache.org/licenses/LICENSE-2.0
     8   *
     9   * Unless required by applicable law or agreed to in writing, software distributed under the License
    10   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
    11   * or implied. See the License for the specific language governing permissions and limitations under
    12   * the License.
    13   *******************************************************************************/
    14  
    15  package logger
    16  
    17  import "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/errors"
    18  
    19  // MockLogger is a type that can be used for mocking the LoggingClient interface during unit tests
    20  type MockLogger struct {
    21  }
    22  
    23  // NewMockClient creates a mock instance of LoggingClient
    24  func NewMockClient() LoggingClient {
    25  	return MockLogger{}
    26  }
    27  
    28  // SetLogLevel simulates setting a log severity level
    29  func (lc MockLogger) SetLogLevel(_ string) errors.EdgeX {
    30  	return nil
    31  }
    32  
    33  // LogLevel returns the current log level setting
    34  func (lc MockLogger) LogLevel() string {
    35  	return ""
    36  }
    37  
    38  // Info simulates logging an entry at the INFO severity level
    39  func (lc MockLogger) Info(_ string, _ ...interface{}) {
    40  }
    41  
    42  // Debug simulates logging an entry at the DEBUG severity level
    43  func (lc MockLogger) Debug(_ string, _ ...interface{}) {
    44  }
    45  
    46  // Error simulates logging an entry at the ERROR severity level
    47  func (lc MockLogger) Error(_ string, _ ...interface{}) {
    48  }
    49  
    50  // Trace simulates logging an entry at the TRACE severity level
    51  func (lc MockLogger) Trace(_ string, _ ...interface{}) {
    52  }
    53  
    54  // Warn simulates logging an entry at the WARN severity level
    55  func (lc MockLogger) Warn(_ string, _ ...interface{}) {
    56  }
    57  
    58  // Infof simulates logging an formatted message at the INFO severity level
    59  func (lc MockLogger) Infof(_ string, _ ...interface{}) {
    60  }
    61  
    62  // Debugf simulates logging an formatted message at the DEBUG severity level
    63  func (lc MockLogger) Debugf(_ string, _ ...interface{}) {
    64  }
    65  
    66  // Errorf simulates logging an formatted message at the ERROR severity level
    67  func (lc MockLogger) Errorf(_ string, _ ...interface{}) {
    68  }
    69  
    70  // Tracef simulates logging an formatted message at the TRACE severity level
    71  func (lc MockLogger) Tracef(_ string, _ ...interface{}) {
    72  }
    73  
    74  // Warnf simulates logging an formatted message at the WARN severity level
    75  func (lc MockLogger) Warnf(_ string, _ ...interface{}) {
    76  }