Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownTag = errors.New("logtemplate: unknown tag")
ErrUnknownTag indicates that the template references a tag that has no registered renderer. The format may be a bare ${tag} or a parametric ${tag:param}; in both cases the unmatched name is reported via UnknownTagError so callers can extract it programmatically.
Functions ¶
Types ¶
type Buffer ¶
type Buffer interface {
Len() int
ReadFrom(r io.Reader) (int64, error)
WriteTo(w io.Writer) (int64, error)
Bytes() []byte
Write(p []byte) (int, error)
WriteByte(c byte) error
WriteString(s string) (int, error)
Set(p []byte)
SetString(s string)
String() string
}
Buffer is the render buffer exposed to template functions. The template renderer only requires Write, WriteByte, and WriteString, but the wider bytebufferpool-compatible surface is kept so existing custom logger tags that use methods such as Len, Bytes, Set, or String continue to compile when switching to the shared template renderer.
type Template ¶
type Template[C, D any] struct { // contains filtered or unexported fields }
Template is a precompiled log template.
type UnknownTagError ¶
UnknownTagError is the typed error returned when a template references an unknown tag. Tag is the offending tag including any parametric suffix (without the surrounding "${" / "}"). Param is the parameter portion when the tag was parametric, or the empty string for bare tags. Hint is an optional human-readable suggestion — currently set when a bare tag was referenced but a parametric base of the same name is registered.
func (*UnknownTagError) Error ¶
func (e *UnknownTagError) Error() string
func (*UnknownTagError) Unwrap ¶
func (*UnknownTagError) Unwrap() error