burrow: github.com/hyperledger/burrow/logging/structure Index | Files

package structure

import "github.com/hyperledger/burrow/logging/structure"

Index

Package Files

structure.go

Constants

const (
    // Log time (time.Time)
    TimeKey = "time"
    // Call site for log invocation (go-stack.Call)
    CallerKey = "caller"
    // Trace for log call
    TraceKey = "trace"
    // Level name (string)
    LevelKey = "level"
    // Channel name in a vector channel logging context
    ChannelKey = "log_channel"
    // Log message (string)
    MessageKey = "message"
    // Error key
    ErrorKey = "error"
    // Tx hash key
    TxHashKey = "tx_hash"
    // Captured logging source (like tendermint_log15, stdlib_log)
    CapturedLoggingSourceKey = "captured_logging_source"
    // Top-level component (choose one) name
    ComponentKey = "component"
    // Tendermint component etc
    Tendermint = "tendermint"
    // Vector-valued scope
    ScopeKey = "scope"
    // Globally unique identifier persisting while a single instance (root process)
    // of this program/service is running
    RunId = "run_id"
    // Provides special instructions (that may be ignored) to downstream loggers
    SignalKey = "__signal__"
    // The sync signal instructs sync-able loggers to sync
    SyncSignal       = "__sync__"
    ReloadSignal     = "__reload__"
    InfoChannelName  = "Info"
    TraceChannelName = "Trace"
)

func Delete Uses

func Delete(slice []interface{}, i int, n int) []interface{}

Deletes n elements starting with the ith from a slice by splicing. Beware uses append so the underlying backing array will be modified!

func DeleteAt Uses

func DeleteAt(slice []interface{}, i int) []interface{}

Delete an element at a specific index and return the contracted list

func DropKeys Uses

func DropKeys(keyvals []interface{}, dropKeyValPredicate func(key, value interface{}) bool) []interface{}

Drops all key value pairs where dropKeyValPredicate is true

func KeyValuesMap Uses

func KeyValuesMap(keyvals []interface{}) map[string]interface{}

Returns keyvals as a map from keys to vals

func MapKeyValues Uses

func MapKeyValues(keyvals []interface{}, fn func(interface{}, interface{}) (interface{}, interface{})) ([]interface{}, error)

Maps key values pairs with a function (key, value) -> (new key, new value)

func OnlyKeys Uses

func OnlyKeys(keyvals []interface{}, includeKeys ...interface{}) []interface{}

func Reload Uses

func Reload(logger log.Logger) error

func RemoveKeys Uses

func RemoveKeys(keyvals []interface{}, dropKeys ...interface{}) []interface{}

func Signal Uses

func Signal(keyvals []interface{}) string

Tried to interpret the logline as a signal by matching the last key-value pair as a signal, returns empty string if no match. The idea with signals is that the should be transmitted to a root logger as a single key-value pair so we avoid the need to do a linear probe over every log line in order to detect a signal.

func Stringify Uses

func Stringify(v interface{}) string

Provides a canonical way to stringify keys

func Sync Uses

func Sync(logger log.Logger) error

Sends the sync signal which causes any syncing loggers to sync. loggers receiving the signal should drop the signal logline from output

func Value Uses

func Value(keyvals []interface{}, key interface{}) interface{}

Return a single value corresponding to key in keyvals

func ValuesAndContext Uses

func ValuesAndContext(keyvals []interface{},
    keys ...interface{}) (map[string]interface{}, []interface{})

Pull the specified values from a structured log line into a map. Assumes keys are single-valued. Returns a map of the key-values from the requested keys and the unmatched remainder keyvals as context as a slice of key-values.

func Vectorise Uses

func Vectorise(keyvals []interface{}, vectorKeys ...string) []interface{}

'Vectorises' values associated with repeated string keys member by collapsing many values into a single vector value. The result is a copy of keyvals where the first occurrence of each matching key and its first value are replaced by that key and all of its values in a single slice.

type Vector Uses

type Vector []interface{}

To help with downstream serialisation

func (Vector) MarshalJSON Uses

func (v Vector) MarshalJSON() ([]byte, error)

func (Vector) MarshalText Uses

func (v Vector) MarshalText() ([]byte, error)

func (Vector) Slice Uses

func (v Vector) Slice() []interface{}

func (Vector) String Uses

func (v Vector) String() string

Package structure imports 3 packages (graph) and is imported by 80 packages. Updated 2020-05-03. Refresh now. Tools for package owners.