Documentation ¶
Overview ¶
* Apache License 2.0 * * Copyright (c) 2022, Austin Zhai * All rights reserved.
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Printf(level Level, format string, v ...interface{})
- func Println(level Level, v ...interface{})
- func SetFlags(flag int)
- func SetLevel(level Level)
- func SetOutput(out io.Writer)
- func SetPrefix(prefix string)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Level
- type Log
- func (log *Log) Debug(v ...interface{})
- func (log *Log) Debugf(format string, v ...interface{})
- func (log *Log) Error(v ...interface{})
- func (log *Log) Errorf(format string, v ...interface{})
- func (log *Log) Fatal(v ...interface{})
- func (log *Log) Fatalf(format string, v ...interface{})
- func (log *Log) Info(v ...interface{})
- func (log *Log) Infof(format string, v ...interface{})
- func (log *Log) Printf(level Level, format string, v ...interface{})
- func (log *Log) Println(level Level, v ...interface{})
- func (log *Log) SetFlags(flag int)
- func (log *Log) SetLevel(level Level)
- func (log *Log) SetOutput(out io.Writer)
- func (log *Log) SetPrefix(prefix string)
- func (log *Log) Trace(v ...interface{})
- func (log *Log) Tracef(format string, v ...interface{})
- func (log *Log) Warn(v ...interface{})
- func (log *Log) Warnf(format string, v ...interface{})
- func (log *Log) WithFlags(flag int) *Log
- func (log *Log) WithLevel(level Level) *Log
- func (log *Log) WithOutput(out io.Writer) *Log
- type Logger
Constants ¶
View Source
const ( Ldate = 1 << iota // the date in the local time zone: 2009/01/23 Ltime // the time in the local time zone: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone Lmsgprefix // move the "prefix" from the beginning of the line to before the message Lfuncname LstdFlags = Ldate | Ltime // initial values for the standard logger )
These flags define which text to prefix to each log entry generated by the Logger. Bits are or'ed together to control what's printed. With the exception of the Lmsgprefix flag, there is no control over the order they appear (the order listed here) or the format they present (as described in the comments). The prefix is followed by a colon only when Llongfile or Lshortfile is specified. For example, flags Ldate | Ltime (or LstdFlags) produce,
2009/01/23 01:23:23 message
while flags Ldate | Ltime | Lmicroseconds | Llongfile produce,
2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface { Trace(v ...interface{}) Tracef(format string, v ...interface{}) Debug(v ...interface{}) Debugf(format string, v ...interface{}) Info(v ...interface{}) Infof(format string, v ...interface{}) Warn(v ...interface{}) Warnf(format string, v ...interface{}) Error(v ...interface{}) Errorf(format string, v ...interface{}) }
Click to show internal directories.
Click to hide internal directories.