Documentation
¶
Overview ¶
Package blank provides a Transport that delegates SendToLogger to a user-supplied function. It is useful for prototyping a new transport inline without creating a full package, for one-off integrations (forward to a metrics system, a queue, etc.), and for tests that need to inspect raw TransportParams without writing a TestTransport setup.
If you find yourself reusing the same blank.Config in multiple places, promote it to its own transport package; see /transports/creating-transports.md for the full template.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
transport.BaseConfig
// ShipToLogger is invoked for every entry that passes the transport's
// level filter. If nil, entries are silently discarded (which makes a
// nil-ShipToLogger Transport a useful no-op for tests).
//
// Panics in ShipToLogger are not recovered by this transport. If your
// callback can panic, recover inside it; otherwise the panic
// propagates to the dispatching goroutine.
ShipToLogger func(params loglayer.TransportParams)
}
Config holds configuration for the blank transport.
type Transport ¶
type Transport struct {
transport.BaseTransport
// contains filtered or unexported fields
}
Transport delegates dispatch to the configured ShipToLogger function.
func (*Transport) GetLoggerInstance ¶
GetLoggerInstance returns nil; blank has no underlying library.
func (*Transport) SendToLogger ¶
func (t *Transport) SendToLogger(params loglayer.TransportParams)
SendToLogger implements loglayer.Transport. Calls ShipToLogger if set; otherwise the entry is dropped after the level filter.