logging

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SystemAttributeKey = "serviceweaver/system"

Variables

This section is empty.

Functions

func IsSystemGenerated

func IsSystemGenerated(entry *protos.LogEntry) bool

IsSystemGenerated returns true for log entries generated by system components.

func Shorten

func Shorten(s string) string

Shorten 返回一个s的短前缀

func ShortenComponent

func ShortenComponent(component string) string

Types

type Buffer

type Buffer []byte

Buffer is a byte buffer.

This implementation is adapted from the unexported type buffer in go/src/fmt/print.go.

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Free

func (b *Buffer) Free()

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Reset

func (b *Buffer) Reset()

func (*Buffer) SetLen

func (b *Buffer) SetLen(n int)

func (*Buffer) String

func (b *Buffer) String() string

func (*Buffer) Write

func (b *Buffer) Write(p []byte) (int, error)

func (*Buffer) WriteByte

func (b *Buffer) WriteByte(c byte) error

func (*Buffer) WriteString

func (b *Buffer) WriteString(s string) (int, error)

type PrettyFormatter

type PrettyFormatter interface {
	Format(*protos.LogEntry) string
}

type PrettyPrinter

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

PrettyPrinter pretty prints log entries to json string.

func NewPrettyPrinter

func NewPrettyPrinter(w io.Writer) *PrettyPrinter

func (*PrettyPrinter) Format

func (p *PrettyPrinter) Format(entry *protos.LogEntry) error

Jump to

Keyboard shortcuts

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