test

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Level   string
	Message string
}

LogEntry represents a single log message with its level

type Logger

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

TestLogger is a shared test logger implementation for use across test suites. It implements the core.Logger interface and provides methods to capture and verify log output.

func NewTestLogger

func NewTestLogger(verbose ...bool) *Logger

NewTestLogger creates a new test logger

func (*Logger) Clear

func (l *Logger) Clear()

Clear clears all logged messages

func (*Logger) Criticalf

func (l *Logger) Criticalf(s string, v ...interface{})

Criticalf logs a critical message

func (*Logger) Debug

func (l *Logger) Debug(s string)

func (*Logger) Debugf

func (l *Logger) Debugf(s string, v ...interface{})

Debugf logs a debug message

func (*Logger) Err

func (l *Logger) Err(s string)

Shortened names for brevity

func (*Logger) Error

func (l *Logger) Error(s string)

Deprecated methods for backward compatibility

func (*Logger) ErrorCount

func (l *Logger) ErrorCount() int

ErrorCount returns the number of error messages

func (*Logger) Errorf

func (l *Logger) Errorf(s string, v ...interface{})

Errorf logs an error message

func (*Logger) GetMessages

func (l *Logger) GetMessages() []LogEntry

GetMessages returns all logged messages

func (*Logger) HasError

func (l *Logger) HasError(substr string) bool

HasError checks if an error containing the substring was logged

func (*Logger) HasMessage

func (l *Logger) HasMessage(substr string) bool

HasMessage checks if a message containing the substring was logged

func (*Logger) HasWarning

func (l *Logger) HasWarning(substr string) bool

HasWarning checks if a warning containing the substring was logged

func (*Logger) Info

func (l *Logger) Info(s string)

func (*Logger) Infof

func (l *Logger) Infof(s string, v ...interface{})

Infof logs an info message

func (*Logger) Log

func (l *Logger) Log(s string)

func (*Logger) MessageCount

func (l *Logger) MessageCount() int

MessageCount returns the number of logged messages

func (*Logger) Notice

func (l *Logger) Notice(s string)

func (*Logger) Noticef

func (l *Logger) Noticef(s string, v ...interface{})

Noticef logs a notice message

func (*Logger) Warn

func (l *Logger) Warn(s string)

func (*Logger) Warning

func (l *Logger) Warning(s string)

func (*Logger) WarningCount added in v0.18.0

func (l *Logger) WarningCount() int

WarningCount returns the number of warning messages

func (*Logger) Warningf

func (l *Logger) Warningf(s string, v ...interface{})

Warningf logs a warning message

Directories

Path Synopsis
Package testutil provides common test utilities for the Ofelia project.
Package testutil provides common test utilities for the Ofelia project.

Jump to

Keyboard shortcuts

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