Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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