urknall: github.com/dynport/urknall/pubsub Index | Files

package pubsub

import "github.com/dynport/urknall/pubsub"

Index

Package Files

pubsub.go stdout_logger.go

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"
)

func OpenLogger Uses

func OpenLogger(w io.Writer) io.Closer

Create a logging facility for urknall using urknall's default formatter. Note that this resource must be closed afterwards!

func RegisterPubSub Uses

func RegisterPubSub(ps *pubsub.PubSub)

Register your own instance of the PubSub type to handle logging yourself.

type Message Uses

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) IsStderr Uses

func (message *Message) IsStderr() bool

Predicated to verify whether the given message was sent via stderr.

func (Message) Publish Uses

func (message Message) Publish(key string)

Publish the message with the given key postfix.

func (Message) PublishError Uses

func (message Message) PublishError(e error)

Publish the message with the given error.

func (*Message) PublishPanic Uses

func (message *Message) PublishPanic(e error)

Publish the message with the given error and create a stacktrace.

Package pubsub imports 8 packages (graph) and is imported by 1 packages. Updated 2016-07-31. Refresh now. Tools for package owners.