diagnostics

package
v0.0.1-alpha.22 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_UPDATE_FMT = "internal/log/update:%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendLogger

type BackendLogger struct {
	Sugared *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewBackendLogger

func NewBackendLogger(name string, dev bool) (*BackendLogger, error)

NewBackendLogger creates (and binds) a Zap SugaredLogger writing to `<name>.log`.

func (*BackendLogger) Debug

func (b *BackendLogger) Debug(ctx context.Context, msg string, fields map[string]any)

func (*BackendLogger) Error

func (b *BackendLogger) Error(ctx context.Context, msg string, fields map[string]any)

func (*BackendLogger) Info

func (b *BackendLogger) Info(ctx context.Context, msg string, fields map[string]any)

func (*BackendLogger) ListLogFiles

func (b *BackendLogger) ListLogFiles(ctx context.Context) ([]string, error)

func (*BackendLogger) Log

func (b *BackendLogger) Log(ctx context.Context, level, msg string, fields map[string]any)

func (*BackendLogger) ReadLog

func (b *BackendLogger) ReadLog(ctx context.Context, name string) (string, error)

func (*BackendLogger) SearchLog

func (b *BackendLogger) SearchLog(ctx context.Context, name, pattern string) ([]string, error)

func (*BackendLogger) StartTail

func (b *BackendLogger) StartTail(ctx context.Context, name string) error

func (*BackendLogger) StopTail

func (b *BackendLogger) StopTail(ctx context.Context, name string) error

func (*BackendLogger) Warn

func (b *BackendLogger) Warn(ctx context.Context, msg string, fields map[string]any)

type DiagnosticsClient

type DiagnosticsClient struct {
	UI *BackendLogger
}

DiagnosticsClient provides a client to the UI to be able to record ui side logs, view ui and backend logs, as well as other diagnostic imformation.

func NewDiagnosticsClient

func NewDiagnosticsClient(dev bool) *DiagnosticsClient

func (*DiagnosticsClient) Debug

func (c *DiagnosticsClient) Debug(msg string, fields map[string]any)

Debug records a debug level log to the log sink

func (*DiagnosticsClient) Error

func (c *DiagnosticsClient) Error(msg string, fields map[string]any)

Error records an error level log to the log sink

func (*DiagnosticsClient) Info

func (c *DiagnosticsClient) Info(msg string, fields map[string]any)

Info records an info level log to the log sink

func (*DiagnosticsClient) Log

func (c *DiagnosticsClient) Log(level, msg string, fields map[string]any)

Log records an arbitrary log with a set level to the log sink

func (*DiagnosticsClient) ReadLog

func (c *DiagnosticsClient) ReadLog(logType string) (string, error)

ReadLog returns the string contents of the log requested

func (*DiagnosticsClient) StartTail

func (c *DiagnosticsClient) StartTail(logType string) error

StartTail starts tailing the log to the event stream

func (*DiagnosticsClient) StopTail

func (c *DiagnosticsClient) StopTail(logType string) error

StopTail stops tailing the log to the event stream

func (*DiagnosticsClient) Warn

func (c *DiagnosticsClient) Warn(msg string, fields map[string]any)

Warn records a warn level log to the log sink

Jump to

Keyboard shortcuts

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