Documentation ¶
Index ¶
- Constants
- type Context
- type Fields
- type Log
- func (l Log) Debug(message string)
- func (l Log) Debugf(message string, args ...interface{})
- func (l Log) Error(message string)
- func (l Log) Errorf(message string, args ...interface{})
- func (l Log) Fatal(message string)
- func (l Log) Fatalf(message string, args ...interface{})
- func (l Log) Info(message string)
- func (l Log) Infof(message string, args ...interface{})
- func (l Log) Warn(message string)
- func (l Log) Warnf(message string, args ...interface{})
- func (l *Log) With(fields Fields) *Log
- func (l *Log) WithOutput(w io.Writer) *Log
- type Payload
- type ReportLocation
- type ServiceContext
Constants ¶
View Source
const ( DEBUG severity = iota INFO WARN ERROR CRITICAL )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Data Fields `json:"data,omitempty"` ReportLocation *ReportLocation `json:"reportLocation,omitempty"` }
Context is required by the Stackdriver Error format
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is the main type for the logger package
func (Log) Fatal ¶
Fatal is equivalent to Error() followed by a call to os.Exit(1). It prints out a message with CRITICAL severity level
func (Log) Fatalf ¶
Fatalf is equivalent to Errorf() followed by a call to os.Exit(1). It prints out a message with CRITICAL severity level
type Payload ¶
type Payload struct { Severity string `json:"severity"` EventTime string `json:"eventTime"` Caller string `json:"caller,omitempty"` Message string `json:"message"` ServiceContext *ServiceContext `json:"serviceContext,omitempty"` Context *Context `json:"context,omitempty"` Stacktrace string `json:"stacktrace,omitempty"` }
Payload groups all the data for a log entry
type ReportLocation ¶
type ReportLocation struct { FilePath string `json:"filePath"` FunctionName string `json:"functionName"` LineNumber int `json:"lineNumber"` }
ReportLocation is required by the Stackdriver Error format
type ServiceContext ¶
type ServiceContext struct { Service string `json:"service,omitempty"` Version string `json:"version,omitempty"` }
ServiceContext is required by the Stackdriver Error format
Click to show internal directories.
Click to hide internal directories.