jsonreactorlog

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONReactorLog

type JSONReactorLog struct {
	Host      string  `json:",omitempty"`
	Label     string  `json:",omitempty"`
	Hash      string  `json:",omitempty"`
	Pid       int     `json:",omitempty"`
	RID       uint64  `json:",omitempty"`
	TID       uint64  `json:",omitempty"`
	Line      uint64  // Do not omit line number on line 0
	Output    string  `json:",omitempty"`
	Status    string  `json:",omitempty"`
	Error     string  `json:",omitempty"`
	Elapse    float64 `json:",omitempty"`
	Timestamp int64   `json:",omitempty"`

	sync.Mutex
	// contains filtered or unexported fields
}

JSONReactorLog lets you log as json lines.

func NewJSONReactorLog

func NewJSONReactorLog(logStream lib.LogStream, hostname string, rid uint64, tid uint64) *JSONReactorLog

NewJSONReactorLog returns a logger that sends json lines to the specified LogStream

func (*JSONReactorLog) Done

func (rl *JSONReactorLog) Done(err error)

Done write in the logs the elapse time for the current execution

func (*JSONReactorLog) SetHash added in v1.7.0

func (rl *JSONReactorLog) SetHash(value string)

func (*JSONReactorLog) SetLabel

func (rl *JSONReactorLog) SetLabel(value string)

func (*JSONReactorLog) Start

func (rl *JSONReactorLog) Start(pid int, s string)

Start change status and write the initial command

func (*JSONReactorLog) Write

func (rl *JSONReactorLog) Write(b []byte) (int, error)

Write will be called by the reactor and this bytes will be sent to the general log channel

type ReactorLog

type ReactorLog interface {
	Write(b []byte) (int, error)
	Start(pid int, s string)
	SetLabel(string)
	SetHash(string)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL