Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrettyDuration ¶ added in v0.0.3
func (PrettyDuration) MarshalText ¶ added in v0.0.3
func (pd PrettyDuration) MarshalText() (text []byte, err error)
func (PrettyDuration) String ¶ added in v0.0.3
func (pd PrettyDuration) String() string
type Slogger ¶
type Slogger struct { Writer io.Writer Mode SloggerMode }
func (*Slogger) NewRequest ¶
func (s *Slogger) NewRequest(writeLogsHook func(sr *SloggerRequest)) (sr *SloggerRequest)
type SloggerEvent ¶ added in v0.0.3
type SloggerEvent struct { Severity SloggerEventSeverity Message string }
type SloggerEventSeverity ¶
type SloggerEventSeverity string
const ( SeverityInfo SloggerEventSeverity = "info" SeverityWarning SloggerEventSeverity = "warning" SeverityError SloggerEventSeverity = "error" SeverityWTF SloggerEventSeverity = "wtf" )
type SloggerRequest ¶
type SloggerRequest struct { ClientHost string HttpMethod string HttpPath string HttpStatusCode int ResponseSize int64 RequestTime time.Time RequestDuration PrettyDuration ExtraData map[string]interface{} Events []SloggerEvent // contains filtered or unexported fields }
func (*SloggerRequest) Error ¶
func (sr *SloggerRequest) Error(msg string)
func (*SloggerRequest) FormatLog ¶
func (sr *SloggerRequest) FormatLog(format string, values ...interface{}) (msg string)
func (*SloggerRequest) Info ¶
func (sr *SloggerRequest) Info(msg string)
func (*SloggerRequest) WTF ¶
func (sr *SloggerRequest) WTF(msg string)
func (*SloggerRequest) Warning ¶
func (sr *SloggerRequest) Warning(msg string)
func (*SloggerRequest) WriteLogs ¶
func (sr *SloggerRequest) WriteLogs()
Click to show internal directories.
Click to hide internal directories.