Documentation
¶
Index ¶
- Constants
- func ConfigureProcessLogger()
- func DatadogWebhookIdentity(logger *log.Entry) log.Fields
- func DatadogWebhookLogger() *log.Logger
- func ForEvent(logger *log.Entry, event models.CanvasEvent) *log.Entry
- func ForExecution(execution *models.CanvasNodeExecution) *log.Entry
- func ForFactory(factory models.Factory) *log.Entry
- func ForIntegration(integration models.Integration) *log.Entry
- func ForNode(node models.CanvasNode) *log.Entry
- func ForRun(run models.CanvasRun) *log.Entry
- func ForWorkOrder(workOrder models.FactoryWorkOrder) *log.Entry
- func LogDatadogWebhookError(message string, fields log.Fields, err error)
- func LogDatadogWebhookInfo(message string, fields log.Fields, err error)
- func LogDatadogWebhookWarn(message string, fields log.Fields, err error)
- func LogProductiveWebhookFailure(event string, fields log.Fields, err error)
- func LogProductiveWebhookWarning(event string, message string, fields log.Fields, err error)
- func LogSentryWebhookError(message string, fields log.Fields, err error)
- func LogSentryWebhookInfo(message string, fields log.Fields)
- func LogSentryWebhookWarn(message string, fields log.Fields)
- func ProductiveWebhookLogger() *log.Logger
- func ProductiveWebhookType(event string) string
- func SentryWebhookLogger() *log.Logger
- func WithCanvas(logger *log.Entry, canvas models.Canvas) *log.Entry
- func WithCanvasWorkspace(logger *log.Entry, canvas *models.Canvas) *log.Entry
- func WithDatadogWebhookIdentity(logger *log.Entry, resolve func() log.Fields) *log.Entry
- func WithExecution(logger *log.Entry, execution *models.CanvasNodeExecution) *log.Entry
- func WithFactory(logger *log.Entry, factory models.Factory) *log.Entry
- func WithIntegration(logger *log.Entry, integration models.Integration) *log.Entry
- func WithNode(logger *log.Entry, node models.CanvasNode) *log.Entry
- func WithQueueItem(logger *log.Entry, queueItem models.CanvasNodeQueueItem) *log.Entry
- func WithRun(logger *log.Entry, run models.CanvasRun) *log.Entry
- func WithWebhook(logger *log.Entry, webhook models.Webhook) *log.Entry
- func WithWebhookNode(logger *log.Entry, fields WebhookNodeFields) *log.Entry
- func WithWebhookPayload(fields log.Fields, body []byte) log.Fields
- func WithWorkOrder(logger *log.Entry, workOrder models.FactoryWorkOrder) *log.Entry
- type CloudLoggingFormatter
- type TackleLogger
- type WebhookNodeFields
Constants ¶
const ( // ComponentWebhookProductive is the Cloud Logging component for a // Productive task webhook failure. Filter: // jsonPayload.component="webhook.productive" ComponentWebhookProductive = "webhook.productive" // ComponentWebhookSentry is the Cloud Logging component for a hosted // Sentry webhook. Filter: jsonPayload.component="webhook.sentry" ComponentWebhookSentry = "webhook.sentry" // WebhookLogType is the Cloud Logging type for an integration webhook. // Filter: jsonPayload.type="webhook" WebhookLogType = "webhook" // DatadogIntegration is the Cloud Logging integration for a Datadog webhook. // Filter: jsonPayload.integration="datadog" DatadogIntegration = "datadog" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureProcessLogger ¶
func ConfigureProcessLogger()
ConfigureProcessLogger selects the process log format. LOG_FORMAT=json writes Cloud Logging JSON to stdout. Any other value keeps the text formatter, so worker processes stay unchanged.
func DatadogWebhookIdentity ¶
DatadogWebhookIdentity returns fields from a resolver attached by WithDatadogWebhookIdentity. It returns nil when the logger has no resolver.
func DatadogWebhookLogger ¶
DatadogWebhookLogger returns the JSON logger used for Datadog webhooks.
func ForExecution ¶
func ForExecution(execution *models.CanvasNodeExecution) *log.Entry
func ForIntegration ¶ added in v0.6.0
func ForIntegration(integration models.Integration) *log.Entry
func ForWorkOrder ¶
func ForWorkOrder(workOrder models.FactoryWorkOrder) *log.Entry
func LogDatadogWebhookError ¶
LogDatadogWebhookError writes one JSON error line for a Datadog webhook. type and integration stay set when fields repeat them.
func LogDatadogWebhookInfo ¶
LogDatadogWebhookInfo writes one JSON info line for a Datadog webhook. type and integration stay set when fields repeat them.
func LogDatadogWebhookWarn ¶
LogDatadogWebhookWarn writes one JSON warning line for a Datadog webhook. type and integration stay set when fields repeat them.
func LogProductiveWebhookFailure ¶
LogProductiveWebhookFailure writes one JSON failure line for a Productive task webhook. component and webhookType stay set when fields repeat them.
func LogProductiveWebhookWarning ¶
LogProductiveWebhookWarning writes one JSON warning line for a Productive task webhook that succeeded with less data than expected.
func LogSentryWebhookError ¶
LogSentryWebhookError writes one JSON error line for a hosted Sentry webhook.
func LogSentryWebhookInfo ¶
LogSentryWebhookInfo writes one JSON info line for a hosted Sentry webhook.
func LogSentryWebhookWarn ¶
LogSentryWebhookWarn writes one JSON warning line for a hosted Sentry webhook.
func ProductiveWebhookLogger ¶
ProductiveWebhookLogger returns the JSON logger used for Productive webhook failures.
func ProductiveWebhookType ¶
ProductiveWebhookType returns task.created or task.updated. Any other delivery is unknown.
func SentryWebhookLogger ¶
SentryWebhookLogger returns the JSON logger used for hosted Sentry webhooks.
func WithCanvas ¶ added in v0.30.0
func WithCanvasWorkspace ¶
WithCanvasWorkspace adds organization_id for every canvas, and factory_id when the canvas belongs to a workspace. factory_id is the workspace UUID.
func WithDatadogWebhookIdentity ¶
WithDatadogWebhookIdentity stores a resolver on the logger. The caller runs the resolver only when a delivery line needs the fields.
func WithExecution ¶
func WithIntegration ¶ added in v0.6.0
func WithQueueItem ¶
func WithWebhook ¶ added in v0.27.0
func WithWebhookNode ¶
func WithWebhookNode(logger *log.Entry, fields WebhookNodeFields) *log.Entry
WithWebhookNode adds the SuperPlane organization, canvas, and webhook ids to the logger passed into a webhook handler.
func WithWebhookPayload ¶
WithWebhookPayload adds the incoming webhook body to a log line. Valid JSON stays an object. A body over the limit is cut.
func WithWorkOrder ¶
Types ¶
type CloudLoggingFormatter ¶
type CloudLoggingFormatter struct {
// contains filtered or unexported fields
}
CloudLoggingFormatter writes one JSON object per line with the field names Cloud Logging reads from stdout: severity, message, and time.
func NewCloudLoggingFormatter ¶
func NewCloudLoggingFormatter() *CloudLoggingFormatter
type TackleLogger ¶
type TackleLogger struct {
// contains filtered or unexported fields
}
func NewTackleLogger ¶
func NewTackleLogger(logger *log.Entry) TackleLogger
func (TackleLogger) Errorf ¶
func (l TackleLogger) Errorf(format string, args ...interface{})
func (TackleLogger) Infof ¶
func (l TackleLogger) Infof(format string, args ...interface{})
type WebhookNodeFields ¶
WebhookNodeFields are the canvas and webhook ids added to a node logger when a webhook delivery runs.