logging

package
v0.0.0-...-2d7d218 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package logging is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(w SyslogWriter) slog.Handler

NewHandler creates a slog.Handler backed by the given SyslogWriter. Useful for testing with a mock writer.

func NewSyslogHandler

func NewSyslogHandler(tag string) slog.Handler

NewSyslogHandler returns a slog.Handler that writes to local syslog with the given tag. On any failure, returns a no-op handler — never writes to stderr.

func Sanitize

func Sanitize(s string) string

Sanitize replaces newlines and NULs that would break syslog single-line framing. Stdlib syslog.Writer does not strip embedded newlines from messages, so we sanitize to keep LIDE replicator regex compatibility.

Types

type MockSyslogWriter

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

MockSyslogWriter is a mock of SyslogWriter interface.

func NewMockSyslogWriter

func NewMockSyslogWriter(ctrl *gomock.Controller) *MockSyslogWriter

NewMockSyslogWriter creates a new mock instance.

func (*MockSyslogWriter) Debug

func (m_2 *MockSyslogWriter) Debug(m string) error

Debug mocks base method.

func (*MockSyslogWriter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSyslogWriter) Err

func (m_2 *MockSyslogWriter) Err(m string) error

Err mocks base method.

func (*MockSyslogWriter) Info

func (m_2 *MockSyslogWriter) Info(m string) error

Info mocks base method.

func (*MockSyslogWriter) Warning

func (m_2 *MockSyslogWriter) Warning(m string) error

Warning mocks base method.

type MockSyslogWriterMockRecorder

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

MockSyslogWriterMockRecorder is the mock recorder for MockSyslogWriter.

func (*MockSyslogWriterMockRecorder) Debug

Debug indicates an expected call of Debug.

func (*MockSyslogWriterMockRecorder) Err

Err indicates an expected call of Err.

func (*MockSyslogWriterMockRecorder) Info

Info indicates an expected call of Info.

func (*MockSyslogWriterMockRecorder) Warning

func (mr *MockSyslogWriterMockRecorder) Warning(m any) *gomock.Call

Warning indicates an expected call of Warning.

type NoopHandler

type NoopHandler struct{}

NoopHandler discards all log records.

func (NoopHandler) Enabled

func (NoopHandler) Handle

func (NoopHandler) WithAttrs

func (NoopHandler) WithAttrs([]slog.Attr) slog.Handler

func (NoopHandler) WithGroup

func (NoopHandler) WithGroup(string) slog.Handler

type SyslogWriter

type SyslogWriter interface {
	Debug(m string) error
	Info(m string) error
	Warning(m string) error
	Err(m string) error
}

SyslogWriter abstracts the level-specific write methods of *syslog.Writer. Exported for mock generation via go.uber.org/mock.

Jump to

Keyboard shortcuts

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