Documentation
¶
Overview ¶
Package stdlog provide log utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnelineLog ¶
func OnelineLog() bool
OnelineLog is derived from "OnelineLog" env variable according to strconv.ParseBool
func TimestampLog ¶
func TimestampLog() bool
TimestampLog is derived from "TimestampLog" env variable according to strconv.ParseBool
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represent logging object.
func Err ¶
func Err() *Logger
Err return global err Logger
if SetErr never called before, will return Logger that wrap os.Stderr and behave acording to OnelineLog and NoTimestampLog
func New ¶
New create new logger that write to b,
if timestamp is true, every Print will prefixed with timestamp.
if onelines is true, every Write will formated into JSON string, this option is ignored when w is *Logger
func NewFromEnv ¶
NewFromEnv is same as New but timestamp and onelines are inherited from env
func Out ¶
func Out() *Logger
Out return global out Logger
if SetOut never called before, will return Logger that wrap os.Stdout and behave acording to OnelineLog and NoTimestampLog