Documentation ¶
Overview ¶
Major parts of this implementation are copied verbatim from https://github.com/golang/glog.
Index ¶
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Raw(s string)
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(format string, args ...interface{})
- type NopLogger
- func (*NopLogger) Debug(args ...interface{})
- func (*NopLogger) Debugf(format string, args ...interface{})
- func (*NopLogger) Error(args ...interface{})
- func (*NopLogger) Errorf(format string, args ...interface{})
- func (n *NopLogger) Fatal(args ...interface{})
- func (*NopLogger) Fatalf(format string, args ...interface{})
- func (*NopLogger) Info(args ...interface{})
- func (*NopLogger) Infof(format string, args ...interface{})
- func (*NopLogger) Raw(s string)
- func (*NopLogger) Warning(args ...interface{})
- func (*NopLogger) Warningf(format string, args ...interface{})
- type Options
- type SyncWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger collects all the global state of the logging setup.
*Logger implements the slog.Logger interface.
func NewFromOptions ¶
type NopLogger ¶
type NopLogger struct{}
NopLogger implements slog.Logger and does nothing.
func (*NopLogger) Debug ¶
func (*NopLogger) Debug(args ...interface{})
Debug logs debugging logs. Arguments are handled in the manner of fmt.Print.
func (*NopLogger) Debugf ¶
Debugf logs debugging logs. Arguments are handled in the manner of fmt.Printf.
func (*NopLogger) Error ¶
func (*NopLogger) Error(args ...interface{})
Error logs error logs. Arguments are handled in the manner of fmt.Print.
func (*NopLogger) Errorf ¶
Errorf logs error logs. Arguments are handled in the manner of fmt.Printf.
func (*NopLogger) Fatal ¶
func (n *NopLogger) Fatal(args ...interface{})
Fatal logs a fatal log and then exits the program. Arguments are handled in the manner of fmt.Print.
func (*NopLogger) Fatalf ¶
Fatalf logs a fatal log and then exits the program. Arguments are handled in the manner of fmt.Printf.
func (*NopLogger) Info ¶
func (*NopLogger) Info(args ...interface{})
Info logs informational logs. Arguments are handled in the manner of fmt.Print.
func (*NopLogger) Infof ¶
Infof logs informational logs. Arguments are handled in the manner of fmt.Printf.
type Options ¶
type Options struct { // SyncWriter is the destination to write logs to. If left nil then os.Stdout // will be used. SyncWriter SyncWriter // IncludeDebug is true will emit Debug/Debugf logs, otherwise those logs are ignored. IncludeDebug bool // DepthDelta is the number of extra stack levels to look up when reporting the calling function. // // Useful if Logger is going to be wrapped inside another logging module. DepthDelta int }
Options is passed to NewFromOptions to control some aspects of the created Logger.