Documentation ¶
Index ¶
- Constants
- func NewHttpWriter(url string) io.Writer
- func NewJsonFormatter() *jsonFormatter
- type AggregateField
- type BasicLogger
- type ErrorRecordingOutput
- type Field
- func BlockHeight(value primitives.BlockHeight) *Field
- func Bytes(key string, value []byte) *Field
- func Error(value error) *Field
- func Float32(key string, value float32) *Field
- func Float64(key string, value float64) *Field
- func Function(value string) *Field
- func Int(key string, value int) *Field
- func Int32(key string, value int32) *Field
- func Int64(key string, value int64) *Field
- func Node(value string) *Field
- func Service(value string) *Field
- func Source(value string) *Field
- func String(key string, value string) *Field
- func Stringable(key string, value fmt.Stringer) *Field
- func StringableSlice(key string, values interface{}) *Field
- func Timestamp(key string, value time.Time) *Field
- func TimestampNano(key string, value primitives.TimestampNano) *Field
- func Transaction(txHash primitives.Sha256) *Field
- func Uint(key string, value uint) *Field
- func Uint32(key string, value uint32) *Field
- func Uint64(key string, value uint64) *Field
- func VirtualChainId(value primitives.VirtualChainId) *Field
- type FieldType
- type Filter
- func DiscardAll() Filter
- func ExcludeEntryPoint(name string) Filter
- func ExcludeField(field *Field) Filter
- func IgnoreErrorsMatching(pattern string) Filter
- func IgnoreMessagesMatching(pattern string) Filter
- func IncludeFieldWithKey(key string) Filter
- func MatchField(f *Field) Filter
- func OnlyCheckpoints() Filter
- func OnlyErrors() Filter
- func OnlyMetrics() Filter
- func Or(filters ...Filter) Filter
- type LogFormatter
- type Output
Constants ¶
View Source
const ( NoType = iota ErrorType NodeType ServiceType StringType IntType UintType BytesType FloatType FunctionType SourceType StringArrayType TimeType AggregateType )
View Source
const ( SPACE = " " EQUALS = "=" )
View Source
const DEFAULT_TIMESTAMP_COLUMN = "timestamp"
View Source
const TIMESTAMP_FORMAT = "2006-01-02T15:04:05.999999999Z"
Variables ¶
This section is empty.
Functions ¶
func NewHttpWriter ¶
func NewJsonFormatter ¶
func NewJsonFormatter() *jsonFormatter
Types ¶
type AggregateField ¶
type AggregateField interface {
NestedFields() []*Field
}
type BasicLogger ¶
type BasicLogger interface { Log(level string, message string, params ...*Field) LogFailedExpectation(message string, expected *Field, actual *Field, params ...*Field) Info(message string, params ...*Field) Error(message string, params ...*Field) Metric(params ...*Field) WithTags(params ...*Field) BasicLogger Tags() []*Field WithOutput(writer ...Output) BasicLogger WithFilters(filter ...Filter) BasicLogger }
func GetLogger ¶
func GetLogger(params ...*Field) BasicLogger
type ErrorRecordingOutput ¶
type ErrorRecordingOutput struct {
// contains filtered or unexported fields
}
func NewErrorRecordingOutput ¶
func NewErrorRecordingOutput(allowedErrors []string) *ErrorRecordingOutput
func (*ErrorRecordingOutput) Append ¶
func (o *ErrorRecordingOutput) Append(level string, message string, params ...*Field)
func (*ErrorRecordingOutput) GetUnexpectedErrors ¶
func (o *ErrorRecordingOutput) GetUnexpectedErrors() (errors []string)
func (*ErrorRecordingOutput) HasErrors ¶
func (o *ErrorRecordingOutput) HasErrors() bool
type Field ¶
type Field struct { Key string Type FieldType StringVal string StringArray []string Int int64 Uint uint64 Bytes []byte Float float64 Error error Nested AggregateField }
func BlockHeight ¶
func BlockHeight(value primitives.BlockHeight) *Field
func StringableSlice ¶
func TimestampNano ¶
func TimestampNano(key string, value primitives.TimestampNano) *Field
func Transaction ¶
func Transaction(txHash primitives.Sha256) *Field
func VirtualChainId ¶
func VirtualChainId(value primitives.VirtualChainId) *Field
type Filter ¶
func DiscardAll ¶
func DiscardAll() Filter
func ExcludeEntryPoint ¶
func ExcludeField ¶
func IgnoreErrorsMatching ¶
func IgnoreMessagesMatching ¶
func IncludeFieldWithKey ¶
func MatchField ¶
func OnlyCheckpoints ¶
func OnlyCheckpoints() Filter
func OnlyMetrics ¶
func OnlyMetrics() Filter
type LogFormatter ¶
type LogFormatter interface {
FormatRow(timestamp time.Time, level string, message string, params ...*Field) (formattedRow string)
}
func NewHumanReadableFormatter ¶
func NewHumanReadableFormatter() LogFormatter
type Output ¶
func NewBulkOutput ¶
func NewBulkOutput(writer io.Writer, formatter LogFormatter, bulkSize int) Output
func NewFormattingOutput ¶
func NewFormattingOutput(writer io.Writer, formatter LogFormatter) Output
Click to show internal directories.
Click to hide internal directories.