Documentation ¶
Index ¶
Constants ¶
const ( StatusCached = "CACHED" StatusExecStart = "EXEC" StatusExecFinished = "FINISHED" )
const ( MessageTasksPrecompile = "urknall.tasks.precompile" MessageUrknallInternal = "urknall.internal" MessageCleanupCacheEntries = "urknall.cleanup_cache_entries" MessageTasksProvision = "urknall.tasks.provision.list" MessageTasksProvisionTask = "urknall.tasks.provision.task" )
Variables ¶
This section is empty.
Functions ¶
func OpenLogger ¶
Create a logging facility for urknall using urknall's default formatter. Note that this resource must be closed afterwards!
func RegisterPubSub ¶
Register your own instance of the PubSub type to handle logging yourself.
Types ¶
type Message ¶
type Message struct { Key string // Key the message is sent with. ExecStatus string // Urknall status (executed or cached). Message string // The message to be logged. Hostname string // IP of the host a command is run. TaskName string // Name of the package currently being executed. TaskChecksum string // Hash of a task. PublishedAt time.Time // When was the message published. StartedAt time.Time // When was the message created. Duration time.Duration // How long did the action take (delta from message creation and publishing). TotalRuntime time.Duration // Timeframe of the action (might be larger than the message's). Stream string // Stream a line appeared on. Line string // Line that appeared on a stream. InvalidatedCacheEntries []string // List of invalidated cache entries (urknall caching). Error error // Error that occured. Stack string // The stack trace in case of a panic. }
Urknall uses the http://github.com/dynport/dgtk/pubsub package for logging (a publisher-subscriber pattern where defined messages are sent to subscribers). This is the message type urknall will send out. If you handle logging yourself this type provides the required information. Please note that this message is sent in different context's and not all fields will be set all the time.
func (Message) PublishError ¶
Publish the message with the given error.
func (*Message) PublishPanic ¶
Publish the message with the given error and create a stacktrace.