Documentation
¶
Overview ¶
Package capturelog provides an in-memory implementation of mcpx.Logger that records every event for later assertion. Used by integration and security tests.
Index ¶
- type Entry
- type Level
- type Logger
- func (l *Logger) Contains(substr string) bool
- func (l *Logger) ContainsAtLevel(lvl Level, substr string) bool
- func (l *Logger) ContainsField(key string, value any) bool
- func (l *Logger) Debug(msg string, fields ...mcpx.Field)
- func (l *Logger) Entries() []Entry
- func (l *Logger) EntriesAtLevel(lvl Level) []Entry
- func (l *Logger) Error(msg string, fields ...mcpx.Field)
- func (l *Logger) Info(msg string, fields ...mcpx.Field)
- func (l *Logger) Reset()
- func (l *Logger) Warn(msg string, fields ...mcpx.Field)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger captures events in memory. Safe for concurrent use.
func (*Logger) Contains ¶
Contains reports whether substr appears in the message of any captured event or in the rendered string form of any field value.
func (*Logger) ContainsAtLevel ¶
ContainsAtLevel is Contains but limited to the given level.
func (*Logger) ContainsField ¶
ContainsField reports whether any captured event has a field with the given key whose value equals (or stringifies to the same as) value.
func (*Logger) EntriesAtLevel ¶
EntriesAtLevel returns a copy of captured events at the given level.
Click to show internal directories.
Click to hide internal directories.