Skip to content

rslog.CapturingLogger: Messages returns its underlying message slice #207

Open
@aronatkins

Description

@aronatkins

The capturing logger returns its underlying message slice, allowing a caller to modify the recorded message contents.

func (l *CapturingLogger) Messages() []string {
return l.hook.Messages()
}

func (h *captureMessageHook) Messages() []string {
h.mu.RLock()
defer h.mu.RUnlock()
return h.messages
}

Messages() should return a copy of its message slice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions