Documentation ¶
Index ¶
- Variables
- func FileInfo(depth int) (string, string, int)
- func NewContextWithLogger(parent context.Context, l *Logger) context.Context
- type Config
- type LogConfig
- type LogContext
- type LogEntry
- type LogRequest
- type LogRuntime
- type LogTags
- type Logger
- func (l *Logger) Critical(f string, v ...interface{}) *LogEntry
- func (l *Logger) Debug(f string, v ...interface{}) *LogEntry
- func (l *Logger) Error(f string, v ...interface{}) *LogEntry
- func (l *Logger) FillInRuntimeMetadata()
- func (l *Logger) Finish()
- func (l *Logger) Info(f string, v ...interface{}) *LogEntry
- func (l *Logger) Record(severity Severity, message string) *LogEntry
- func (l *Logger) Start() func()
- func (l *Logger) Warning(f string, v ...interface{}) *LogEntry
- type Manager
- type Severity
- type SeverityCount
Constants ¶
This section is empty.
Variables ¶
View Source
var Severities = map[Severity]string{ SeverityDebug: "DEBUG", SeverityInfo: "INFO", SeverityWarning: "WARNING", SeverityError: "ERROR", SeverityCritical: "CRITICAL", }
Functions ¶
Types ¶
type Config ¶
type Config struct { Type string DefaultSeverity Severity OutputSeverity Severity JsonIndent bool ElapsedUnit time.Duration }
func NewConfigDefault ¶
func NewConfigDefault() *Config
type LogContext ¶
type LogContext struct { FunctionName string `json:"functionName"` FunctionVersion string `json:"functionVersion"` MemoryLimitInMega int `json:"memoryLimitInMega"` InvokedFunctionArn string `json:"invokedFunctionArn"` AwsRequestId string `json:"awsRequestId"` }
func NewLogContext ¶
func NewLogContext(ctx context.Context) *LogContext
type LogEntry ¶
type LogEntry struct { Severity Severity `json:"severity"` Message string `json:"message"` Time time.Time `json:"time,omitempty"` Filename string `json:"filename,omitempty"` Fileline int `json:"fileline,omitempty"` Funcname string `json:"funcname,omitempty"` Tags []string `json:"tags,omitempty"` Elapsed float64 `json:"elapsed,omitempty"` Attributes interface{} `json:"attributes,omitempty"` Error string `json:"error,omitempty"` }
func (*LogEntry) WithAttributes ¶
type LogRequest ¶
type LogRequest struct { Type string `json:"type"` Context *LogContext `json:"context"` Runtime *LogRuntime `json:"runtime"` Config *LogConfig `json:"config"` }
type LogRuntime ¶
type LogRuntime struct { Severity Severity `json:"severity"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` Elapsed int64 `json:"elapsed"` Lines []*LogEntry `json:"lines,omitempty"` Tags LogTags `json:"tags,omitempty"` Severities SeverityCount `json:"-"` }
func NewLogRuntime ¶
func NewLogRuntime() *LogRuntime
func (*LogRuntime) AppendLogEntry ¶
func (lr *LogRuntime) AppendLogEntry(l *LogEntry)
type Logger ¶
type Logger struct { Config *Config LogRequest *LogRequest }
func NewLoggerDefault ¶
func (*Logger) FillInRuntimeMetadata ¶
func (l *Logger) FillInRuntimeMetadata()
type Manager ¶
type Manager struct {
Config *Config
}
func NewManager ¶
func NewManagerDefault ¶
func NewManagerDefault() *Manager
type SeverityCount ¶
func (SeverityCount) CountUp ¶
func (sc SeverityCount) CountUp(s Severity)
func (SeverityCount) HighestSeverity ¶
func (sc SeverityCount) HighestSeverity() Severity
Click to show internal directories.
Click to hide internal directories.