Documentation

Index

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 is like strings.Builder, but with maximum length. If the caller tries to add data beyond the capacity, they will be dropped, and Logger.String() will append "(truncated)" at the end.

    func NewLogger

    func NewLogger(maxLen int) *Logger

      NewLogger creates a new Logger object with the given capacity.

      func (*Logger) String

      func (b *Logger) String() string

        String reports the data written so far. If the length of the data exceeds the buffer capacity, the prefix of the data, plus "(truncated)" will be reported.

        func (*Logger) Write

        func (b *Logger) Write(data []byte) (int, error)

          Write implements io.Writer interface.

          Source Files