logger

package module
v0.0.0-...-06ab379 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 8 Imported by: 0

README

logger

golang syslog wrapper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func NewDefaultLogger

func NewDefaultLogger() (*Logger, error)

func NewLogger

func NewLogger(ctx context.Context, opts ...Option) (*Logger, error)

func (*Logger) AddOptions

func (lg *Logger) AddOptions(opts ...Option) error

func (*Logger) Log

func (lg *Logger) Log(level types.LogLevel, tag, msg string, kvs ...string)

type Option

type Option func(*Logger) error

func WithDelimiter

func WithDelimiter(delimiter string) Option

func WithFileWriter

func WithFileWriter(addr string) Option

func WithHttpListener

func WithHttpListener(port int) Option

func WithLocalWriter

func WithLocalWriter(tag string, priority syslog.Priority, bufferLen int) Option

func WithLogLevel

func WithLogLevel(level types.LogLevel) Option

func WithNSQWriter

func WithNSQWriter(addr, topic string) Option

func WithTCPConnection

func WithTCPConnection(addr, tag string, priority syslog.Priority, bufferLen int) Option

func WithTimeLog

func WithTimeLog(format string, loc *time.Location) Option

func WithUDPConnection

func WithUDPConnection(addr, tag string, priority syslog.Priority, bufferLen int) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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