logger

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReceiveLogThroughPipe

func ReceiveLogThroughPipe(receivingLogger Logger, pipe *os.File, marshalizer marshaling.Marshalizer) error

ReceiveLogThroughPipe reads a log message from the pipe and sends it to a regular Node logger

Types

type LogLevel

type LogLevel uint8

LogLevel defines the priority level of a log line. Trace is the lowest priority level, Error is the highest

const (
	LogTrace   LogLevel = 0
	LogDebug   LogLevel = 1
	LogInfo    LogLevel = 2
	LogWarning LogLevel = 3
	LogError   LogLevel = 4
	LogNone    LogLevel = 5
)

These constants are the string representation of the package logging levels.

func ParseLogLevel

func ParseLogLevel(str string) LogLevel

ParseLogLevel gets a log level from a string

type LogMessage

type LogMessage struct {
	Level   LogLevel
	Message string
	Args    []interface{}
}

LogMessage is a log message

type Logger

type Logger interface {
	Trace(message string, args ...interface{})
	Debug(message string, args ...interface{})
	Info(message string, args ...interface{})
	Warn(message string, args ...interface{})
	Error(message string, args ...interface{})
}

Logger is the logger interface

func NewDefaultLogger

func NewDefaultLogger(level LogLevel) Logger

NewDefaultLogger creates a logger

func NewPipeLogger

func NewPipeLogger(level LogLevel, pipe *os.File, marshalizer marshaling.Marshalizer) Logger

NewPipeLogger creates a new pipe logger

type PipeLogger

type PipeLogger struct {
	// contains filtered or unexported fields
}

PipeLogger is a pipe-based logger

func (*PipeLogger) Debug

func (pipeLogger *PipeLogger) Debug(message string, args ...interface{})

Debug logs

func (*PipeLogger) Error

func (pipeLogger *PipeLogger) Error(message string, args ...interface{})

Error logs

func (*PipeLogger) Info

func (pipeLogger *PipeLogger) Info(message string, args ...interface{})

Info logs

func (*PipeLogger) Trace

func (pipeLogger *PipeLogger) Trace(message string, args ...interface{})

Trace logs

func (*PipeLogger) Warn

func (pipeLogger *PipeLogger) Warn(message string, args ...interface{})

Warn logs

Jump to

Keyboard shortcuts

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