logger

package
v0.0.0-...-91b1b85 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

The oryx logger package provides connection-oriented log service.

logger.Info.Println(Context, ...)
logger.Trace.Println(Context, ...)
logger.Warn.Println(Context, ...)
logger.Error.Println(Context, ...)

@remark the Context is optional thus can be nil.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() (err error)

The interface io.Closer Cleanup the logger, discard any log util switch to fresh writer.

func E

func E(ctx Context, a ...interface{})

Alias for Error level println.

func I

func I(ctx Context, a ...interface{})

Alias for Info level println.

func Switch

func Switch(w io.Writer)

Switch the underlayer io. @remark user must close previous io for logger never close it.

func T

func T(ctx Context, a ...interface{})

Alias for Trace level println.

func W

func W(ctx Context, a ...interface{})

Alias for Warn level println.

Types

type Context

type Context interface {
	// get current goroutine cid.
	Cid() int
}

the context for current goroutine.

type Logger

type Logger interface {
	// Println for logger plus,
	// @param ctx the connection-oriented context, or nil to ignore.
	Println(ctx Context, a ...interface{})
}

The logger for oryx.

var Error Logger

Error, the error level, fatal error things, ot stderr.

var Info Logger

Info, the verbose info level, very detail log, the lowest level, to discard.

var Trace Logger

Trace, the trace level, something important, the default log level, to stdout.

var Warn Logger

Warn, the warning level, dangerous information, to stderr.

func NewLoggerPlus

func NewLoggerPlus(l *log.Logger) Logger

Jump to

Keyboard shortcuts

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