Documentation
¶
Index ¶
- Constants
- func LogFatalOnError(lg Logger, err error, action string)
- func LogWarnOnError(lg Logger, err error, action string)
- func SetEntryLoggerFunc(loggerFunc EntryLoggerFunc)
- type Entry
- type EntryLogWrapper
- func (lg *EntryLogWrapper) Error(args ...interface{})
- func (lg *EntryLogWrapper) Errorf(f string, args ...interface{})
- func (lg *EntryLogWrapper) Fatal(args ...interface{})
- func (lg *EntryLogWrapper) Fatalf(f string, args ...interface{})
- func (lg *EntryLogWrapper) Info(args ...interface{})
- func (lg *EntryLogWrapper) Infof(f string, args ...interface{})
- func (lg *EntryLogWrapper) Warn(args ...interface{})
- func (lg *EntryLogWrapper) Warnf(f string, args ...interface{})
- func (lg *EntryLogWrapper) WithField(k string, v interface{}) Logger
- func (lg *EntryLogWrapper) WithFields(f map[string]interface{}) Logger
- func (lg *EntryLogWrapper) WithHTTPRequest(r *http.Request) Logger
- type EntryLogger
- type EntryLoggerFunc
- type Logger
Constants ¶
View Source
const ( FieldAction = "action" FieldTransID = "transactionID" FieldURL = "url" FieldHost = "host" FieldHTTPMethod = "httpMethod" FieldRPCMethod = "rpcMethod" FieldRequest = "request" FieldResponseCode = "ResponseCode" FieldService = "service" FieldRequestHandler = "requestType" FieldClientAppUserID = "ClientAppUserID" )
View Source
const ( LevelInfo = "Info" LevelWarn = "Warn" LevelError = "Error" LevelFatal = "Fatal" )
Variables ¶
This section is empty.
Functions ¶
func LogFatalOnError ¶
func LogWarnOnError ¶
func SetEntryLoggerFunc ¶
func SetEntryLoggerFunc(loggerFunc EntryLoggerFunc)
Types ¶
type EntryLogWrapper ¶
EntryLogWrapper implements the Logger interface by using an EntryLoggerFunc to print out the final log. To use an entry logger, add a blank identifier import e.g. for the standard logger use:
_ "github.com/tomogoma/authms/logging/standard"
for the purpose of its side effects.
func (*EntryLogWrapper) Error ¶
func (lg *EntryLogWrapper) Error(args ...interface{})
func (*EntryLogWrapper) Errorf ¶
func (lg *EntryLogWrapper) Errorf(f string, args ...interface{})
func (*EntryLogWrapper) Fatal ¶
func (lg *EntryLogWrapper) Fatal(args ...interface{})
func (*EntryLogWrapper) Fatalf ¶
func (lg *EntryLogWrapper) Fatalf(f string, args ...interface{})
func (*EntryLogWrapper) Info ¶
func (lg *EntryLogWrapper) Info(args ...interface{})
func (*EntryLogWrapper) Infof ¶
func (lg *EntryLogWrapper) Infof(f string, args ...interface{})
func (*EntryLogWrapper) Warn ¶
func (lg *EntryLogWrapper) Warn(args ...interface{})
func (*EntryLogWrapper) Warnf ¶
func (lg *EntryLogWrapper) Warnf(f string, args ...interface{})
func (*EntryLogWrapper) WithField ¶
func (lg *EntryLogWrapper) WithField(k string, v interface{}) Logger
func (*EntryLogWrapper) WithFields ¶
func (lg *EntryLogWrapper) WithFields(f map[string]interface{}) Logger
func (*EntryLogWrapper) WithHTTPRequest ¶
func (lg *EntryLogWrapper) WithHTTPRequest(r *http.Request) Logger
type EntryLogger ¶
type EntryLogger interface {
Log(Entry)
}
type EntryLoggerFunc ¶
type EntryLoggerFunc func(entry Entry)
type Logger ¶
type Logger interface {
WithHTTPRequest(r *http.Request) Logger
WithFields(map[string]interface{}) Logger
WithField(string, interface{}) Logger
Infof(fmt string, args ...interface{})
Warnf(fmt string, args ...interface{})
Errorf(fmt string, args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
Fatal(args ...interface{})
}
Click to show internal directories.
Click to hide internal directories.