Documentation ¶
Index ¶
- Constants
- func CompressForDeflate(b []byte) (string, error)
- func Send(ctx context.Context, l *Logger)
- func SetFunctionLoggerExtraToCtx(ctx context.Context, extra FunctionLoggerExtra) context.Context
- func SetLogger(ctx context.Context, l *Logger) context.Context
- func TimeNowMils() int64
- type ExtraInfo
- type FormatLog
- type FunctionLoggerExtra
- type I18nTag
- type Log
- type Logger
- type Tag
Constants ¶
View Source
const ( LogDomain = "lowcode_func_log" NormalLog = 1 AggregationLog = 2 LogLevelError = 4 LogLevelWarn = 5 LogLevelInfo = 6 LogCountLimit = 10000 LogLengthLimit = 10000 LogLengthLimitTip = `\n... The log has been truncated because it exceeds the length limit.` LogCountLimitTip = `The log has been discarded because it exceeded the limit of 10000` )
Variables ¶
This section is empty.
Functions ¶
func CompressForDeflate ¶
func SetFunctionLoggerExtraToCtx ¶
func SetFunctionLoggerExtraToCtx(ctx context.Context, extra FunctionLoggerExtra) context.Context
func TimeNowMils ¶
func TimeNowMils() int64
Types ¶
type FormatLog ¶ added in v0.0.29
type FormatLog struct { Level int `json:"level"` // 日志级别, 4-error,5-warn,6-info EventID string `json:"event_id"` // 事件 ID,可观测需要 FunctionAPIID string `json:"function_api_id"` // 函数 API ID LogID string `json:"log_id"` // 日志 ID,事件编号与日志编号有一一对应关系 Timestamp int64 `json:"timestamp"` // 时间 Message string `json:"message"` // 用户的日志内容,SDK 会对超长日志截断 TenantID int64 `json:"tenant_id"` // 租户 ID TenantType int64 `json:"tenant_type"` // 租户 ID Namespace string `json:"namespace"` // 命名空间 }
type FunctionLoggerExtra ¶
type FunctionLoggerExtra struct { FunctionLabel structs.I18n `json:"functionLabel"` SourceID string `json:"sourceID"` SourceLabel structs.I18n `json:"sourceLabel"` FunctionVersionID int64 `json:"functionVersionID"` ObjectLabel structs.I18n `json:"objectLabel"` InstanceID int64 `json:"instanceID"` StartTriggerTime int64 `json:"startTriggerTime"` }
FunctionLoggerExtra Only Logger 使用的参数
type Log ¶
type Log struct { Domain string `json:"domain"` Type int `json:"type"` Level int `json:"level"` CreateTime int64 `json:"createTime"` RequestID string `json:"RequestID"` Sequence int64 `json:"sequence"` Content string `json:"content"` Tags []Tag `json:"tags"` TagsI18n []I18nTag `json:"tagsI18n"` ExtraInfo ExtraInfo `json:"extraInfo"` }
type Logger ¶
type Logger struct { RequestID string // contains filtered or unexported fields }
func NewConsoleLogger ¶ added in v0.0.23
Click to show internal directories.
Click to hide internal directories.