github.com/unigraph-dev/dgraph@v1.1.1-0.20200923154953-8b52b426f765/x/log.go (about)

     1  /*
     2   * Copyright 2019 Dgraph Labs, Inc. and Contributors
     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 x
    18  
    19  import (
    20  	"log"
    21  
    22  	"github.com/golang/glog"
    23  )
    24  
    25  // ToGlog is a logger that forwards the output to glog.
    26  type ToGlog struct {
    27  }
    28  
    29  func (rl *ToGlog) Debug(v ...interface{})                   { glog.V(3).Info(v...) }
    30  func (rl *ToGlog) Debugf(format string, v ...interface{})   { glog.V(3).Infof(format, v...) }
    31  func (rl *ToGlog) Error(v ...interface{})                   { glog.Error(v...) }
    32  func (rl *ToGlog) Errorf(format string, v ...interface{})   { glog.Errorf(format, v...) }
    33  func (rl *ToGlog) Info(v ...interface{})                    { glog.Info(v...) }
    34  func (rl *ToGlog) Infof(format string, v ...interface{})    { glog.Infof(format, v...) }
    35  func (rl *ToGlog) Warning(v ...interface{})                 { glog.Warning(v...) }
    36  func (rl *ToGlog) Warningf(format string, v ...interface{}) { glog.Warningf(format, v...) }
    37  func (rl *ToGlog) Fatal(v ...interface{})                   { glog.Fatal(v...) }
    38  func (rl *ToGlog) Fatalf(format string, v ...interface{})   { glog.Fatalf(format, v...) }
    39  func (rl *ToGlog) Panic(v ...interface{})                   { log.Panic(v...) }
    40  func (rl *ToGlog) Panicf(format string, v ...interface{})   { log.Panicf(format, v...) }