pclog

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUniqueID added in v0.43.1

func GenerateUniqueID(length int) string

func Name2Color added in v1.46.0

func Name2Color(name string) func(a ...interface{}) string

Name2Color returns the color for the given name.

Types

type ColorTracker added in v1.46.0

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

func NewColorTracker added in v1.46.0

func NewColorTracker() *ColorTracker

func (*ColorTracker) GetColor added in v1.46.0

func (c *ColorTracker) GetColor(name string) func(a ...interface{}) string

GetColor returns the color for the given name.

type Connector added in v0.43.1

type Connector struct {
	LogObserver
	// contains filtered or unexported fields
}

func NewConnector added in v0.43.1

func NewConnector(mlHandler multiLineHandler, slHandler lineHandler, tail int) *Connector

func (*Connector) GetTailLength added in v0.43.1

func (c *Connector) GetTailLength() int

func (*Connector) GetUniqueID added in v0.43.1

func (c *Connector) GetUniqueID() string

func (*Connector) SetLines added in v0.43.1

func (c *Connector) SetLines(lines []string)

func (*Connector) WriteString added in v0.50.0

func (c *Connector) WriteString(s string) (n int, err error)

type LogObserver added in v0.43.1

type LogObserver interface {
	WriteString(line string) (n int, err error)
	SetLines(lines []string)
	GetTailLength() int
	GetUniqueID() string
}

type PCLog

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

func NewLogger

func NewLogger() *PCLog

func (*PCLog) Close

func (l *PCLog) Close()

func (*PCLog) Error

func (l *PCLog) Error(message string, process string, replica int)

func (*PCLog) Info

func (l *PCLog) Info(message string, process string, replica int)

func (*PCLog) Open added in v0.51.4

func (l *PCLog) Open(filePath string, config *types.LoggerConfig)

type PcLogger

type PcLogger interface {
	Open(filePath string, rotation *types.LoggerConfig)
	Info(message string, process string, replica int)
	Error(message string, process string, replica int)
	Close()
}

type PcNilLog

type PcNilLog struct {
}

func NewNilLogger

func NewNilLogger() *PcNilLog

func (*PcNilLog) Close

func (l *PcNilLog) Close()

func (*PcNilLog) Error

func (l *PcNilLog) Error(message string, process string, replica int)

func (*PcNilLog) Info

func (l *PcNilLog) Info(message string, process string, replica int)

func (*PcNilLog) Open added in v0.51.4

func (l *PcNilLog) Open(filePath string, rotation *types.LoggerConfig)

func (*PcNilLog) Sync

func (l *PcNilLog) Sync()

type ProcessLogBuffer

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

func NewLogBuffer

func NewLogBuffer(size int) *ProcessLogBuffer

func (*ProcessLogBuffer) Close added in v0.55.0

func (b *ProcessLogBuffer) Close()

func (*ProcessLogBuffer) GetLogLength added in v0.10.0

func (b *ProcessLogBuffer) GetLogLength() int

func (*ProcessLogBuffer) GetLogRange added in v0.10.0

func (b *ProcessLogBuffer) GetLogRange(offsetFromEnd, limit int) []string

func (*ProcessLogBuffer) GetLogsAndSubscribe added in v0.10.0

func (b *ProcessLogBuffer) GetLogsAndSubscribe(observer LogObserver)

func (*ProcessLogBuffer) Subscribe added in v0.43.1

func (b *ProcessLogBuffer) Subscribe(observer LogObserver)

func (*ProcessLogBuffer) UnSubscribe added in v0.10.0

func (b *ProcessLogBuffer) UnSubscribe(observer LogObserver)

func (*ProcessLogBuffer) Write

func (b *ProcessLogBuffer) Write(message string)

Jump to

Keyboard shortcuts

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