import "github.com/dynport/urknall/pubsub"
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" )
Create a logging facility for urknall using urknall's default formatter. Note that this resource must be closed afterwards!
Register your own instance of the PubSub type to handle logging yourself.
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.
Predicated to verify whether the given message was sent via stderr.
Publish the message with the given key postfix.
Publish the message with the given error.
Publish the message with the given error and create a stacktrace.
Package pubsub imports 8 packages (graph) and is imported by 2 packages. Updated 2016-07-31. Refresh now. Tools for package owners.