mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
[no-relnote] Create a Mock logger interfact to enable testing
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
This commit is contained in:
parent
b934c68bef
commit
4930f680a4
46
internal/logger/mock.go
Normal file
46
internal/logger/mock.go
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
# Copyright (c) NVIDIA CORPORATION. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
**/
|
||||||
|
|
||||||
|
package logger
|
||||||
|
|
||||||
|
// MockLogger is a mock implementation of the logger.Interface
|
||||||
|
type MockLogger struct{}
|
||||||
|
|
||||||
|
// NewMockLogger returns a new mock logger
|
||||||
|
func NewMockLogger() *MockLogger {
|
||||||
|
return &MockLogger{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debugf is a no-op for the mock logger
|
||||||
|
func (l *MockLogger) Debugf(format string, args ...interface{}) {}
|
||||||
|
|
||||||
|
// Errorf is a no-op for the mock logger
|
||||||
|
func (l *MockLogger) Errorf(format string, args ...interface{}) {}
|
||||||
|
|
||||||
|
// Info is a no-op for the mock logger
|
||||||
|
func (l *MockLogger) Info(args ...interface{}) {}
|
||||||
|
|
||||||
|
// Infof is a no-op for the mock logger
|
||||||
|
func (l *MockLogger) Infof(format string, args ...interface{}) {}
|
||||||
|
|
||||||
|
// Warning is a no-op for the mock logger
|
||||||
|
func (l *MockLogger) Warning(args ...interface{}) {}
|
||||||
|
|
||||||
|
// Warningf is a no-op for the mock logger
|
||||||
|
func (l *MockLogger) Warningf(format string, args ...interface{}) {}
|
||||||
|
|
||||||
|
// Tracef is a no-op for the mock logger
|
||||||
|
func (l *MockLogger) Tracef(format string, args ...interface{}) {}
|
||||||
Loading…
Reference in New Issue
Block a user