Documentation
¶
Index ¶
- Constants
- type BackendLogger
- func (b *BackendLogger) Debug(ctx context.Context, msg string, fields map[string]any)
- func (b *BackendLogger) Error(ctx context.Context, msg string, fields map[string]any)
- func (b *BackendLogger) Info(ctx context.Context, msg string, fields map[string]any)
- func (b *BackendLogger) ListLogFiles(ctx context.Context) ([]string, error)
- func (b *BackendLogger) Log(ctx context.Context, level, msg string, fields map[string]any)
- func (b *BackendLogger) ReadLog(ctx context.Context, name string) (string, error)
- func (b *BackendLogger) SearchLog(ctx context.Context, name, pattern string) ([]string, error)
- func (b *BackendLogger) StartTail(ctx context.Context, name string) error
- func (b *BackendLogger) StopTail(ctx context.Context, name string) error
- func (b *BackendLogger) Warn(ctx context.Context, msg string, fields map[string]any)
- type DiagnosticsClient
- func (c *DiagnosticsClient) Debug(msg string, fields map[string]any)
- func (c *DiagnosticsClient) Error(msg string, fields map[string]any)
- func (c *DiagnosticsClient) Info(msg string, fields map[string]any)
- func (c *DiagnosticsClient) Log(level, msg string, fields map[string]any)
- func (c *DiagnosticsClient) ReadLog(logType string) (string, error)
- func (c *DiagnosticsClient) StartTail(logType string) error
- func (c *DiagnosticsClient) StopTail(logType string) error
- func (c *DiagnosticsClient) Warn(msg string, fields map[string]any)
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) ListLogFiles ¶
func (b *BackendLogger) ListLogFiles(ctx context.Context) ([]string, error)
func (*BackendLogger) StartTail ¶
func (b *BackendLogger) StartTail(ctx context.Context, name string) error
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
Click to show internal directories.
Click to hide internal directories.