logger

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg LogConfig) zerolog.Logger

func TeeCloud

func TeeCloud(w io.Writer) zerolog.LevelWriter

Types

type ConsoleAdapter

type ConsoleAdapter struct {
	Cons console.Console
	F    File
}

func (ConsoleAdapter) Size

func (ca ConsoleAdapter) Size() (WinSize, error)

func (*ConsoleAdapter) Write

func (ca *ConsoleAdapter) Write(b []byte) (int, error)

type ConsoleSizer

type ConsoleSizer interface {
	Size() (WinSize, error)
}

type ConsoleWriter

type ConsoleWriter interface {
	io.Writer
	ConsoleSizer
}

type Event

type Event map[string]interface{}

type EventV2

type EventV2 map[string]interface{}

type File

type File interface {
	io.ReadWriteCloser

	// Fd returns its file descriptor
	Fd() uintptr
	// Name returns its file name
	Name() string
}

type Group

type Group struct {
	Name         string
	CurrentState task.State
	FinalState   task.State
	Events       []Event
	Started      *time.Time
	Completed    *time.Time
	Members      int
}

type GroupV2

type GroupV2 struct {
	Name         string
	CurrentState task.State
	FinalState   task.State
	Events       []EventV2
	Started      time.Time
	Completed    time.Time
	Members      int
}

type LogConfig

type LogConfig struct {
	Level  string
	Format string
}

type Logs

type Logs struct {
	Messages []Message
	// contains filtered or unexported fields
}

func (*Logs) Add

func (l *Logs) Add(event Event) error

type LogsV2

type LogsV2 struct {
	Messages []MessageV2
	// contains filtered or unexported fields
}

func (*LogsV2) Add

func (l *LogsV2) Add(event EventV2) error

Add add the event to the logs.

type Message

type Message struct {
	Event Event
	Group *Group
}

type MessageV2

type MessageV2 struct {
	EventV2 EventV2
	GroupV2 *GroupV2
}

type PlainOutput

type PlainOutput struct {
	Out io.Writer
}

func (*PlainOutput) Write

func (c *PlainOutput) Write(p []byte) (int, error)

type TTYOutput

type TTYOutput struct {
	// contains filtered or unexported fields
}

func NewTTYOutput

func NewTTYOutput(w *os.File) (*TTYOutput, error)

func (*TTYOutput) Start

func (c *TTYOutput) Start()

func (*TTYOutput) Stop

func (c *TTYOutput) Stop()

func (*TTYOutput) Write

func (c *TTYOutput) Write(p []byte) (n int, err error)

type TTYOutputV2

type TTYOutputV2 struct {
	// contains filtered or unexported fields
}

func NewTTYOutputConsole

func NewTTYOutputConsole(w ConsoleWriter) (*TTYOutputV2, error)

func NewTTYOutputV2

func NewTTYOutputV2(w File) (*TTYOutputV2, error)

func (*TTYOutputV2) Start

func (c *TTYOutputV2) Start()

func (*TTYOutputV2) Stop

func (c *TTYOutputV2) Stop()

func (*TTYOutputV2) Write

func (c *TTYOutputV2) Write(p []byte) (n int, err error)

type WinSize

type WinSize console.WinSize

Jump to

Keyboard shortcuts

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