logsink

package
v0.0.0-...-f26991d Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogSinkFileConfig = &logSinkFileConfig{}

Functions

func UseEnvConfig

func UseEnvConfig()

func UseFileConfig

func UseFileConfig()

Types

type IOLogSink

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

io.Writer based log sink. Write a log line per a record on the storage related with io.Writer

func NewIOLogSink

func NewIOLogSink(format string, writer io.Writer) *IOLogSink

Return a new IOLogSink object. format string can have following variables.

  • $TIMESTAMP : timestamp of a log record
  • $LOGLEVEL : log level
  • $SOURCE_FILE : source file name where a record is produced.
  • $SOURCE_LINE : a line no of source file where a record is produced.
  • $GOROUTINE : Goroutine ID
  • $SESSSION_ID : Session ID
  • $REQUEST_ID : Request ID
  • $USER_ID : User ID
  • $TEXT : text message produced by app.

and if it is "", "[$GOROUTINE:$USER_ID:$SESSION_ID:$REQUEST_ID] $TEXT ($SOURCE_FILE#$SOURCE_LINE)" is used.

func NewIOLogSinkFromConfig

func NewIOLogSinkFromConfig(cfg *logSinkFileConfig) *IOLogSink

func (IOLogSink) AsyncSupport

func (w IOLogSink) AsyncSupport() bool

func (IOLogSink) Close

func (w IOLogSink) Close() error

func (IOLogSink) Format

func (w IOLogSink) Format(r *wcg.LogRecord) []byte

func (IOLogSink) Open

func (w IOLogSink) Open() error

func (IOLogSink) Write

func (w IOLogSink) Write(r *wcg.LogRecord) error

Jump to

Keyboard shortcuts

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