diagnostics

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// StartupReportEnv names a file the startup report is written to as JSON.
	// Used by scripts/perf/coldstart.sh.
	StartupReportEnv = "OMNIVIEW_STARTUP_REPORT"
	// StartupExitEnv makes the app quit as soon as the startup report is written.
	StartupExitEnv = "OMNIVIEW_STARTUP_EXIT"
)
View Source
const (
	// LogUpdateFmt is the event name format used to stream new lines of a tailed log.
	LogUpdateFmt = "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, logDir string) (*BackendLogger, error)

NewBackendLogger creates (and binds) a Zap SugaredLogger writing to `<name>.log`. logDir is the directory where log files are stored (e.g. from appstate.Service.Logs().ResolvePath("")).

func (*BackendLogger) Debug

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

func (*BackendLogger) Error

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

func (*BackendLogger) Info

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

func (*BackendLogger) ListLogFiles

func (b *BackendLogger) ListLogFiles(_ 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(_ context.Context, name string) (string, error)

func (*BackendLogger) SearchLog

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

func (*BackendLogger) ServiceShutdown added in v0.4.0

func (b *BackendLogger) ServiceShutdown() error

func (*BackendLogger) ServiceStartup added in v0.4.0

func (b *BackendLogger) ServiceStartup(_ context.Context, _ application.ServiceOptions) error

func (*BackendLogger) StartTail

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

func (*BackendLogger) StopTail

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

func (*BackendLogger) Warn

func (b *BackendLogger) Warn(_ 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, logDir string) *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) ReportStartupReady added in v0.4.0

func (c *DiagnosticsClient) ReportStartupReady(marks map[string]float64)

ReportStartupReady is called once by the frontend when the shell is first interactive. marks carries frontend timings (milliseconds). The report is printed to stderr, and written to $OMNIVIEW_STARTUP_REPORT when set.

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