klog

package
v0.0.0-...-82e3c6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTrace = 0
	LogDebug = 1
	LogInfo  = 2
	LogWarn  = 3
	LogError = 4
)

Variables

View Source
var KLog = Logger{Name: "KIPFS", Skip: 2, LogSink: StdoutLogSink{UseColor: true}}

Functions

This section is empty.

Types

type Log

type Log interface {
	Trace(s string, a ...interface{})
	Debug(s string, a ...interface{})
	Info(s string, a ...interface{})
	Warn(s string, a ...interface{})
	Error(s string, a ...interface{})
}

type LogSink

type LogSink interface {
	WriteMsg(
		logName string,
		level int,
		message string,
		functionName string,
		fileName string,
		lineNo int,
	)
}

type Logger

type Logger struct {
	LogSink
	Name string
	Skip int
}

func (Logger) Debug

func (l Logger) Debug(s string, a ...interface{})

func (Logger) Error

func (l Logger) Error(s string, a ...interface{})

func (Logger) Info

func (l Logger) Info(s string, a ...interface{})

func (Logger) Trace

func (l Logger) Trace(s string, a ...interface{})

func (Logger) Warn

func (l Logger) Warn(s string, a ...interface{})

type NoopLogSink

type NoopLogSink struct {
}

func (NoopLogSink) WriteMsg

func (s NoopLogSink) WriteMsg(logName string,
	level int,
	message string,
	functionName string,
	fileName string,
	lineNo int)

type NoopLogger

type NoopLogger struct {
	Name string
	Skip int
}

func (NoopLogger) Debug

func (l NoopLogger) Debug(s string)

func (NoopLogger) Error

func (l NoopLogger) Error(s string)

func (NoopLogger) Info

func (l NoopLogger) Info(s string)

func (NoopLogger) Trace

func (l NoopLogger) Trace(s string)

func (NoopLogger) Warn

func (l NoopLogger) Warn(s string)

type StdoutLogSink

type StdoutLogSink struct {
	UseColor bool
}

func (StdoutLogSink) WriteMsg

func (s StdoutLogSink) WriteMsg(
	logName string,
	level int,
	message string,
	functionName string,
	fileName string,
	lineNo int,
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL