Documentation
¶
Index ¶
- type DefaultLogger
- func (l *DefaultLogger) Debug(msg string, rest ...interface{})
- func (l *DefaultLogger) Fatal(msg string, rest ...interface{})
- func (l *DefaultLogger) Info(msg string, rest ...interface{})
- func (l *DefaultLogger) SetDebug(junk bool)
- func (l *DefaultLogger) SetLogFile(junk string)
- func (l *DefaultLogger) Warn(msg string, rest ...interface{})
- type ILogger
- type Logger
- type MockLogger
- func (l *MockLogger) Debug(msg string, rest ...interface{})
- func (l *MockLogger) Fatal(msg string, rest ...interface{})
- func (l *MockLogger) Info(msg string, rest ...interface{})
- func (l *MockLogger) SetDebug(junk bool)
- func (l *MockLogger) SetLogFile(junk string)
- func (l *MockLogger) Warn(msg string, rest ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
}
Default logging structure.
This is a simple implementation of the `ILogger` interface that simply redirects messages to `log.Printf`.
It is used in the same way as the main `Logger` implementation.
func (*DefaultLogger) Debug ¶
func (l *DefaultLogger) Debug(msg string, rest ...interface{})
Write a debug message to the log.
func (*DefaultLogger) Fatal ¶
func (l *DefaultLogger) Fatal(msg string, rest ...interface{})
Write a fatal message to the log and then exit.
func (*DefaultLogger) Info ¶
func (l *DefaultLogger) Info(msg string, rest ...interface{})
Write an information message to the log.
func (*DefaultLogger) SetLogFile ¶
func (l *DefaultLogger) SetLogFile(junk string)
Set the log file to use.
func (*DefaultLogger) Warn ¶
func (l *DefaultLogger) Warn(msg string, rest ...interface{})
Write a warning message to the log.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logging structure.
To use,
1) Create a logger:
lgr := logger.NewLogger("/path/to/log")
2) Do things with it:
lgr.Warn("Not enough coffee!")
lgr.Info("Water is heating up.")
// and so on.
If an empty string is passed to `NewLogger`, then the log facility will display messages on standard output.
func NewLoggerWithFile ¶
Create a new logger with the given log file.
type MockLogger ¶
Mock logger for Go testing framework.
To use, be sure to set `Test` to your test's `testing.T` instance.
func (*MockLogger) Debug ¶
func (l *MockLogger) Debug(msg string, rest ...interface{})
Write a debug message to the log.
func (*MockLogger) Fatal ¶
func (l *MockLogger) Fatal(msg string, rest ...interface{})
Write a fatal message to the log and then exit.
func (*MockLogger) Info ¶
func (l *MockLogger) Info(msg string, rest ...interface{})
Write an information message to the log.
func (*MockLogger) SetLogFile ¶
func (l *MockLogger) SetLogFile(junk string)
Set the log file to use.
func (*MockLogger) Warn ¶
func (l *MockLogger) Warn(msg string, rest ...interface{})
Write a warning message to the log.