tools: golang.org/x/tools/internal/lsp/xlog Index | Files

package xlog

import "golang.org/x/tools/internal/lsp/xlog"

Index

Package Files

xlog.go

Constants

const (
    ErrorLevel = Level(iota)
    InfoLevel
    DebugLevel
)

func Debugf Uses

func Debugf(ctx context.Context, format string, args ...interface{})

func Errorf Uses

func Errorf(ctx context.Context, format string, args ...interface{})

func From Uses

func From(ctx context.Context) logger

func Infof Uses

func Infof(ctx context.Context, format string, args ...interface{})

func With Uses

func With(ctx context.Context, sink Sink) context.Context

type Level Uses

type Level int

Level indicates the severity of the logging message.

type Sink Uses

type Sink interface {
    Log(ctx context.Context, level Level, message string)
}

Sink is the interface to something that consumes logging messages. This can be implemented and then registered with a context to control the destination or formatting of logging.

type StdSink Uses

type StdSink struct{}

StdSink is a Sink that writes to the standard log package.

func (StdSink) Log Uses

func (StdSink) Log(ctx context.Context, level Level, message string)

Log implements Sink for the StdSink. It writes the message using log.Print with a level based prefix.

Package xlog imports 3 packages (graph) and is imported by 8 packages. Updated 2019-07-17. Refresh now. Tools for package owners.