logging

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldLevel   = "level"
	FieldMessage = "msg"
	FieldTime    = "time"
)
View Source
const (
	JobField    string = "job"
	SubsysField string = "subsystem"
)
View Source
const HumanFormatterDateFormat = time.RFC3339

Variables

This section is empty.

Functions

func LogSubsystem

func LogSubsystem(log logger.Logger, subsys Subsystem) logger.Logger

func OutletsFromConfig

func OutletsFromConfig(in config.LoggingOutletEnumList) (*logger.Outlets, error)

func WithSubsystemLoggers

func WithSubsystemLoggers(ctx context.Context, log logger.Logger) context.Context

Types

type EntryFormatter

type EntryFormatter interface {
	SetMetadataFlags(flags MetadataFlags)
	Format(e *logger.Entry) ([]byte, error)
}

type HumanFormatter

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

func (*HumanFormatter) Format

func (f *HumanFormatter) Format(e *logger.Entry) (out []byte, err error)

func (*HumanFormatter) SetIgnoreFields

func (f *HumanFormatter) SetIgnoreFields(ignore []string)

func (*HumanFormatter) SetMetadataFlags

func (f *HumanFormatter) SetMetadataFlags(flags MetadataFlags)

type JSONFormatter

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

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(e *logger.Entry) ([]byte, error)

func (*JSONFormatter) SetMetadataFlags

func (f *JSONFormatter) SetMetadataFlags(flags MetadataFlags)

type LogfmtFormatter

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

func (*LogfmtFormatter) Format

func (f *LogfmtFormatter) Format(e *logger.Entry) ([]byte, error)

func (*LogfmtFormatter) SetMetadataFlags

func (f *LogfmtFormatter) SetMetadataFlags(flags MetadataFlags)

type MetadataFlags

type MetadataFlags int64
const (
	MetadataTime MetadataFlags = 1 << iota
	MetadataLevel
	MetadataColor

	MetadataNone MetadataFlags = 0
	MetadataAll  MetadataFlags = ^0
)

type NoFormatter

type NoFormatter struct{}

func (NoFormatter) Format

func (f NoFormatter) Format(e *logger.Entry) ([]byte, error)

func (NoFormatter) SetMetadataFlags

func (f NoFormatter) SetMetadataFlags(flags MetadataFlags)

type Subsystem

type Subsystem string
const (
	SubsysReplication  Subsystem = "repl"
	SubsyEndpoint      Subsystem = "endpoint"
	SubsysPruning      Subsystem = "pruning"
	SubsysSnapshot     Subsystem = "snapshot"
	SubsysTransport    Subsystem = "transport"
	SubsysTransportMux Subsystem = "transportmux"
	SubsysRPC          Subsystem = "rpc"
	SubsysRPCControl   Subsystem = "rpc.ctrl"
	SubsysRPCData      Subsystem = "rpc.data"
)

type SyslogOutlet

type SyslogOutlet struct {
	Formatter     EntryFormatter
	RetryInterval time.Duration
	Facility      syslog.Priority
	// contains filtered or unexported fields
}

func (*SyslogOutlet) WriteEntry

func (o *SyslogOutlet) WriteEntry(entry logger.Entry) error

type TCPOutlet

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

func NewTCPOutlet

func NewTCPOutlet(formatter EntryFormatter, network, address string, tlsConfig *tls.Config, retryInterval time.Duration) *TCPOutlet

func (*TCPOutlet) Close

func (h *TCPOutlet) Close()

FIXME: use this method

func (*TCPOutlet) WriteEntry

func (h *TCPOutlet) WriteEntry(e logger.Entry) error

type WriterOutlet

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

func (WriterOutlet) WriteEntry

func (h WriterOutlet) WriteEntry(entry logger.Entry) error

Jump to

Keyboard shortcuts

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