syslog

package
v0.0.0-...-f382dc8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	log.Formatter
	// contains filtered or unexported fields
}

Handler can send log to syslog

func NewHandler

func NewHandler(w *syslog.Writer) (*Handler, error)

NewHandler creates a Handler with given syslog.Writer which could be created by syslog.New, the log format as follows:

"[{{app_id}} {{rpc_id}} {{request_id}}] ## {{}}"

func NewHandlerWithFormat

func NewHandlerWithFormat(w *syslog.Writer, f log.Formatter) *Handler

NewHandlerWithFormat is just like NewHandler but with customized format string

func (*Handler) Log

func (sh *Handler) Log(r log.Record)

Log prints the Record info syslog writer

func (*Handler) Writer

func (sh *Handler) Writer() io.Writer

Writer return the writer

Jump to

Keyboard shortcuts

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