log

package
v0.19.1102 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuditAttr      = "nuon.audit"
	AuditAttrValue = "true"

	AuditEventAttr   = "nuon.audit.event"
	AuditOutcomeAttr = "nuon.audit.outcome"
)

AuditAttr tags records the bundled collector forwards to the customer's backend. Its filter drops anything where the log record attribute nuon.audit != "true", so the value must be this exact string and must be a record attribute rather than a resource attribute.

View Source
const (
	OutcomeStarted   = "started"
	OutcomeSucceeded = "succeeded"
	OutcomeFailed    = "failed"
)

Variables

This section is empty.

Functions

func AsDevLogger

func AsDevLogger(f any) any

func AsSystemLogger

func AsSystemLogger(f any) any

func AuditEvent added in v0.19.1097

func AuditEvent(l *zap.Logger, msg, outcome string, fields ...zap.Field)

AuditEvent emits one audit record, and does nothing when l is nil so callers can pass the result of NewAudit straight through without branching on whether the job was auditable.

func AuditEventType added in v0.19.1097

func AuditEventType(job *models.AppRunnerJob) string

func IsAuditable added in v0.19.1097

func IsAuditable(job *models.AppRunnerJob) bool

func NewAudit added in v0.19.1097

func NewAudit(l *zap.Logger, job *models.AppRunnerJob) *zap.Logger

NewAudit derives an audit logger from a job logger. It returns nil for jobs whose group is not auditable, so callers must nil-check before emitting; tagging every job would send the runner's entire log volume to the customer.

func NewDev

func NewDev(cfg *runnerconfig.Config) (*zap.Logger, error)

func NewFXLog added in v0.19.1090

func NewFXLog(params FXParams) fxevent.Logger

Lifecycle events log at debug, keeping the dependency graph out of the default info-level logs while leaving it available under LOG_LEVEL=debug. Errors keep fx's default error level.

func NewHClog

func NewHClog(l *zap.Logger) hclog.Logger

func NewOTELJobLogger

func NewOTELJobLogger(cfg *runnerconfig.Config, lp *log.LoggerProvider) (*zap.Logger, error)

func NewSystem

func NewSystem(params SystemParams) *zap.Logger

func SystemHclog

func SystemHclog(params Params) hclog.Logger

NOTE(jm): this will be deprecated once rolled out to each job

Types

type FXParams added in v0.19.1090

type FXParams struct {
	fx.In

	L *zap.Logger `name:"dev"`
}

type Params

type Params struct {
	fx.In

	L *zap.Logger `name:"system"`
}

type SystemParams

type SystemParams struct {
	fx.In

	Cfg      *runnerconfig.Config
	LP       *log.LoggerProvider `name:"system"`
	Settings *settings.Settings
}

the system logger is used to log all things that should not be sent to our API via OTEL

Jump to

Keyboard shortcuts

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