github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/pkg/lorry/engines/kafka/sarama_log_bridge.go (about) 1 /* 2 Copyright 2021 The Dapr Authors 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 http://www.apache.org/licenses/LICENSE-2.0 7 Unless required by applicable law or agreed to in writing, software 8 distributed under the License is distributed on an "AS IS" BASIS, 9 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 See the License for the specific language governing permissions and 11 limitations under the License. 12 */ 13 14 package kafka 15 16 import ( 17 "fmt" 18 19 "github.com/go-logr/logr" 20 ) 21 22 type SaramaLogBridge struct { 23 logger logr.Logger 24 } 25 26 func (b SaramaLogBridge) Print(v ...interface{}) { 27 b.logger.Info(fmt.Sprint(v...)) 28 } 29 30 func (b SaramaLogBridge) Printf(format string, v ...interface{}) { 31 b.logger.Info(fmt.Sprintf(format, v...)) 32 } 33 34 func (b SaramaLogBridge) Println(v ...interface{}) { 35 b.Print(v...) 36 }