vitess.io/vitess@v0.16.2/go/trace/logger.go (about)

     1  /*
     2  Copyright 2021 The Vitess Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8  	http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package trace
    18  
    19  import "vitess.io/vitess/go/vt/log"
    20  
    21  // traceLogger wraps the standard vitess log package to satisfy the datadog and
    22  // jaeger logger interfaces.
    23  type traceLogger struct{}
    24  
    25  // Log is part of the ddtrace.Logger interface. Datadog only ever logs errors.
    26  func (*traceLogger) Log(msg string) { log.Errorf(msg) }
    27  
    28  // Error is part of the jaeger.Logger interface.
    29  func (*traceLogger) Error(msg string) { log.Errorf(msg) }
    30  
    31  // Infof is part of the jaeger.Logger interface.
    32  func (*traceLogger) Infof(msg string, args ...any) { log.Infof(msg, args...) }