Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Add(data WriteData) error
- func (l *Logger) CreateWriteRequest(rows []*SDK.LogEntry, logName string) *SDK.WriteLogEntriesRequest
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) FlushAll() error
- func (l *Logger) SetCommonForceFields(fields []string)
- func (l *Logger) SetCommonLables(labels map[string]string)
- func (l *Logger) SetCommonLogName(logName string)
- func (l *Logger) SetCommonNullFields(fields []string)
- func (l *Logger) SetCommonPartialSuccess(partialSuccess bool)
- func (l *Logger) SetCommonResource(r *Resource)
- func (l *Logger) SetLogger(logger log.Logger)
- func (l *Logger) Write(data WriteData) error
- type Resource
- type Severity
- type WriteData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger repesents stackdriver logger.
func (*Logger) CreateWriteRequest ¶
func (l *Logger) CreateWriteRequest(rows []*SDK.LogEntry, logName string) *SDK.WriteLogEntriesRequest
CreateWriteRequest creates *SDK.WriteLogEntriesRequest from WriteData.
func (*Logger) SetCommonForceFields ¶
SetCommonForceFields sets common FourceSendsFields.
func (*Logger) SetCommonLables ¶
SetCommonLables sets common labels.
func (*Logger) SetCommonLogName ¶
SetCommonLogName sets common Resource.
func (*Logger) SetCommonNullFields ¶
SetCommonNullFields sets common NullFields.
func (*Logger) SetCommonPartialSuccess ¶
SetCommonPartialSuccess sets common PartialSuccess.
func (*Logger) SetCommonResource ¶
SetCommonResource sets common Resource.
type Resource ¶
type Resource struct { Labels map[string]string `json:"labels,omitempty"` Type string `json:"type,omitempty"` ForceSendFields []string `json:"-"` NullFields []string `json:"-"` }
Resource is wrapper struct for SDK.MonitoredResource.
type Severity ¶
type Severity string
Severity is wrapper struct for Log Severity.
const ( SeverityDefault Severity = "DEFAULT" SeverityDebug Severity = "DEBUG" SeverityInfo Severity = "INFO" SeverityNotice Severity = "NOTICE" SeverityWarning Severity = "WARNING" SeverityError Severity = "ERROR" SeverityCritical Severity = "CRITICAL" SeverityAlert Severity = "ALERT" SeverityEmergency Severity = "EMERGENCY" )
severity list
type WriteData ¶
type WriteData struct { Data interface{} // required LogName string // required if commonLogName is empty Severity Severity Labels map[string]string PartialSuccess bool Resource *Resource Timestamp time.Time InsertId string Request *http.Request Response *http.Response Operation *SDK.LogEntryOperation ForceSendFields []string NullFields []string }
WriteData is data struct for LogEntry data.
Click to show internal directories.
Click to hide internal directories.