go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/log Index | Files

package log

import "gopkg.in/src-d/go-vitess.v1/vt/log"

Index

Package Files

log.go

Variables

var (
    // V quickly checks if the logging verbosity meets a threshold.
    V   = func(level int) bool {
        lvl := logrus.GetLevel()
        switch level {
        case 0:
            return lvl == logrus.InfoLevel
        case 1:
            return lvl == logrus.WarnLevel
        case 2:
            return lvl == logrus.ErrorLevel
        case 3:
            return lvl == logrus.FatalLevel
        default:
            return false
        }
    }

    // Flush ensures any pending I/O is written.
    Flush = func() {}

    // Info formats arguments like fmt.Print.
    Info = logrus.Info
    // Infof formats arguments like fmt.Printf.
    Infof = logrus.Infof
    // InfoDepth formats arguments like fmt.Print and uses depth to choose which call frame to log.
    InfoDepth = func(_ int, args ...interface{}) {
        logrus.Info(args...)
    }

    // Warning formats arguments like fmt.Print.
    Warning = logrus.Warning
    // Warningf formats arguments like fmt.Printf.
    Warningf = logrus.Warningf
    // WarningDepth formats arguments like fmt.Print and uses depth to choose which call frame to log.
    WarningDepth = func(depth int, args ...interface{}) {
        logrus.Warning(args...)
    }

    // Error formats arguments like fmt.Print.
    Error = logrus.Error
    // Errorf formats arguments like fmt.Printf.
    Errorf = logrus.Errorf
    // ErrorDepth formats arguments like fmt.Print and uses depth to choose which call frame to log.
    ErrorDepth = func(_ int, args ...interface{}) {
        logrus.Error(args...)
    }

    // Exit formats arguments like fmt.Print.
    Exit = logrus.Panic
    // Exitf formats arguments like fmt.Printf.
    Exitf = logrus.Panicf
    // ExitDepth formats arguments like fmt.Print and uses depth to choose which call frame to log.
    ExitDepth = func(_ int, args ...interface{}) {
        logrus.Panic(args...)
    }

    // Fatal formats arguments like fmt.Print.
    Fatal = logrus.Fatal
    // Fatalf formats arguments like fmt.Printf
    Fatalf = logrus.Fatalf
    // FatalDepth formats arguments like fmt.Print and uses depth to choose which call frame to log.
    FatalDepth = func(_ int, args ...interface{}) {
        logrus.Fatal(args...)
    }
)

type Level Uses

type Level = logrus.Level

Level is used with V() to test log verbosity.

Package log imports 1 packages (graph) and is imported by 128 packages. Updated 2019-06-26. Refresh now. Tools for package owners.