Documentation ¶
Index ¶
- func NewEventLoggerContext(ctx context.Context, logger *Logger) context.Context
- func StandardLogger(l *Logger) *log.Logger
- type EventLoggerContextKey
- type Logger
- func (l *Logger) Init(webhook []byte, repo string, pr uint) error
- func (l *Logger) Printf(msg string, params ...interface{})
- func (l *Logger) SetChartCompleted(name string, status models.NodeChartStatus)
- func (l *Logger) SetChartStarted(name string, status models.NodeChartStatus)
- func (l *Logger) SetCompletedStatus(status models.EventStatus)
- func (l *Logger) SetEnvName(name string) error
- func (l *Logger) SetFailedStatus(ce metahelmlib.ChartError)
- func (l *Logger) SetImageBuildID(name string, furanBuildID guuid.UUID)
- func (l *Logger) SetImageCompleted(name string, err bool)
- func (l *Logger) SetImageStarted(name string)
- func (l *Logger) SetInitialStatus(rc *models.RepoConfig, processingTime time.Duration)
- func (l *Logger) SetK8sNamespace(ns string)
- func (l *Logger) SetNewStatus(etype models.EventStatusType, envName string, rrd models.RepoRevisionData)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventLoggerContext ¶
NewEventLoggerContext returns a context with the Logger embedded as a value
func StandardLogger ¶
StandardLogger returns a log.Logger that writes to l, or a default logger to stdout if l is nil
Types ¶
type EventLoggerContextKey ¶
type EventLoggerContextKey string
type Logger ¶
type Logger struct { DL persistence.EventLoggerDataLayer ID, DeliveryID uuid.UUID Sink io.Writer // ExcludeID determines whether to omit the ID from log strings ExcludeID bool }
Logger is an object that writes log lines to the database in an EventLog as well as to Sink
func GetLogger ¶
GetLogger returns the Logger if present or a default logger that logs to stdout if not present
func (*Logger) Init ¶
Init initializes the EventLog object in the database. This must be called exactly once prior to any log lines. This method will persist the EventLog in the database with a null environment name
func (*Logger) SetChartCompleted ¶ added in v0.7.5
func (l *Logger) SetChartCompleted(name string, status models.NodeChartStatus)
SetChartCompleted marks the chart install/upgrade for the named dependency to completed (name is assumed to exist) with status
func (*Logger) SetChartStarted ¶ added in v0.7.5
func (l *Logger) SetChartStarted(name string, status models.NodeChartStatus)
SetChartStarted marks the chart install/upgrade for the named dependency to started (name is assumed to exist) with status
func (*Logger) SetCompletedStatus ¶ added in v0.7.5
func (l *Logger) SetCompletedStatus(status models.EventStatus)
SetCompletedStatus marks the entire event as completed with status. This is intended to be called once at the end of event processing.
func (*Logger) SetEnvName ¶
SetEnvName sets the environment name for this logger. Init must be called first.
func (*Logger) SetFailedStatus ¶ added in v0.8.0
func (l *Logger) SetFailedStatus(ce metahelmlib.ChartError)
SetFailedStatus marks the entire event as completed with a failed status. This is intended to be called once at the end of event processing.
func (*Logger) SetImageBuildID ¶ added in v0.9.3
SetImageBuildID sets the Furan image build ID
func (*Logger) SetImageCompleted ¶ added in v0.7.5
SetImageStarted marks the image build for the named dependency to completed (name is assumed to exist) and optionally with error if the build failed
func (*Logger) SetImageStarted ¶ added in v0.7.5
SetImageStarted marks the image build for the named dependency to started (name is assumed to exist)
func (*Logger) SetInitialStatus ¶ added in v0.7.5
func (l *Logger) SetInitialStatus(rc *models.RepoConfig, processingTime time.Duration)
SetInitialStatus sets up the initial progress tree and values according to the processed config, and records the time it took to do the config processing. This should be called no more than once per event.
func (*Logger) SetK8sNamespace ¶ added in v0.7.5
func (*Logger) SetNewStatus ¶ added in v0.7.5
func (l *Logger) SetNewStatus(etype models.EventStatusType, envName string, rrd models.RepoRevisionData)
SetNewStatus creates a new empty event status of etype with only config.type, config.status and config.started set. This is intended to be called first and prior to config processing.