logging

package
v1.0.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

func DatadogWebhookIdentity(logger *log.Entry) log.Fields

DatadogWebhookIdentity returns fields from a resolver attached by WithDatadogWebhookIdentity. It returns nil when the logger has no resolver.

func DatadogWebhookLogger

func DatadogWebhookLogger() *log.Logger

DatadogWebhookLogger returns the JSON logger used for Datadog webhooks.

func ForEvent

func ForEvent(logger *log.Entry, event models.CanvasEvent) *log.Entry

func ForExecution

func ForExecution(execution *models.CanvasNodeExecution) *log.Entry

func ForFactory

func ForFactory(factory models.Factory) *log.Entry

func ForIntegration added in v0.6.0

func ForIntegration(integration models.Integration) *log.Entry

func ForNode

func ForNode(node models.CanvasNode) *log.Entry

func ForRun added in v0.30.0

func ForRun(run models.CanvasRun) *log.Entry

func ForWorkOrder

func ForWorkOrder(workOrder models.FactoryWorkOrder) *log.Entry

func LogDatadogWebhookError

func LogDatadogWebhookError(message string, fields log.Fields, err error)

LogDatadogWebhookError writes one JSON error line for a Datadog webhook. type and integration stay set when fields repeat them.

func LogDatadogWebhookInfo

func LogDatadogWebhookInfo(message string, fields log.Fields, err error)

LogDatadogWebhookInfo writes one JSON info line for a Datadog webhook. type and integration stay set when fields repeat them.

func LogDatadogWebhookWarn

func LogDatadogWebhookWarn(message string, fields log.Fields, err error)

LogDatadogWebhookWarn writes one JSON warning line for a Datadog webhook. type and integration stay set when fields repeat them.

func LogProductiveWebhookFailure

func LogProductiveWebhookFailure(event string, fields log.Fields, err error)

LogProductiveWebhookFailure writes one JSON failure line for a Productive task webhook. component and webhookType stay set when fields repeat them.

func LogProductiveWebhookWarning

func LogProductiveWebhookWarning(event string, message string, fields log.Fields, err error)

LogProductiveWebhookWarning writes one JSON warning line for a Productive task webhook that succeeded with less data than expected.

func LogSentryWebhookError

func LogSentryWebhookError(message string, fields log.Fields, err error)

LogSentryWebhookError writes one JSON error line for a hosted Sentry webhook.

func LogSentryWebhookInfo

func LogSentryWebhookInfo(message string, fields log.Fields)

LogSentryWebhookInfo writes one JSON info line for a hosted Sentry webhook.

func LogSentryWebhookWarn

func LogSentryWebhookWarn(message string, fields log.Fields)

LogSentryWebhookWarn writes one JSON warning line for a hosted Sentry webhook.

func ProductiveWebhookLogger

func ProductiveWebhookLogger() *log.Logger

ProductiveWebhookLogger returns the JSON logger used for Productive webhook failures.

func ProductiveWebhookType

func ProductiveWebhookType(event string) string

ProductiveWebhookType returns task.created or task.updated. Any other delivery is unknown.

func SentryWebhookLogger

func SentryWebhookLogger() *log.Logger

SentryWebhookLogger returns the JSON logger used for hosted Sentry webhooks.

func WithCanvas added in v0.30.0

func WithCanvas(logger *log.Entry, canvas models.Canvas) *log.Entry

func WithCanvasWorkspace

func WithCanvasWorkspace(logger *log.Entry, canvas *models.Canvas) *log.Entry

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

func WithDatadogWebhookIdentity(logger *log.Entry, resolve func() log.Fields) *log.Entry

WithDatadogWebhookIdentity stores a resolver on the logger. The caller runs the resolver only when a delivery line needs the fields.

func WithExecution

func WithExecution(
	logger *log.Entry,
	execution *models.CanvasNodeExecution,
) *log.Entry

func WithFactory

func WithFactory(logger *log.Entry, factory models.Factory) *log.Entry

func WithIntegration added in v0.6.0

func WithIntegration(logger *log.Entry, integration models.Integration) *log.Entry

func WithNode

func WithNode(logger *log.Entry, node models.CanvasNode) *log.Entry

func WithQueueItem

func WithQueueItem(logger *log.Entry, queueItem models.CanvasNodeQueueItem) *log.Entry

func WithRun added in v0.30.0

func WithRun(logger *log.Entry, run models.CanvasRun) *log.Entry

func WithWebhook added in v0.27.0

func WithWebhook(logger *log.Entry, webhook models.Webhook) *log.Entry

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

func WithWebhookPayload(fields log.Fields, body []byte) log.Fields

WithWebhookPayload adds the incoming webhook body to a log line. Valid JSON stays an object. A body over the limit is cut.

func WithWorkOrder

func WithWorkOrder(logger *log.Entry, workOrder models.FactoryWorkOrder) *log.Entry

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

func (*CloudLoggingFormatter) Format

func (f *CloudLoggingFormatter) Format(entry *log.Entry) ([]byte, error)

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

type WebhookNodeFields struct {
	OrganizationID string
	CanvasID       string
	WebhookID      string
}

WebhookNodeFields are the canvas and webhook ids added to a node logger when a webhook delivery runs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL