Documentation
¶
Index ¶
- func Configure(level, format string, writer io.Writer)
- func ConfigureWithHTTP(level, url, format, stream, username, password, token string)
- func Debug(msg string, keysAndValues ...any)
- func Error(msg string, keysAndValues ...any)
- func Fatal(msg string, keysAndValues ...any)
- func Flush()
- func GetLogger() logger.Logger
- func Info(msg string, keysAndValues ...any)
- func Local() logger.Logger
- func Pipeline(msg string, keysAndValues ...any)
- func Tee(l logger.Logger)
- func Trace(msg string, keysAndValues ...any)
- func Warn(msg string, keysAndValues ...any)
- func With(key string, value any) logger.Logger
- func WithError(err error) logger.Logger
- func WithGroup(group string) logger.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
Configure sets up the logger with the given settings Call this early in your main() function
func ConfigureWithHTTP ¶ added in v0.24.0
func ConfigureWithHTTP(level, url, format, stream, username, password, token string)
ConfigureWithHTTP sets up the logger to send JSON-formatted records to the given HTTP endpoint. When a URL is configured stderr output is suppressed.
Optional authentication:
- username + password: sent as HTTP Basic Auth on every request.
- token: sent as "Authorization: Bearer <token>"; takes precedence over basic auth when both are configured.
func Flush ¶ added in v0.33.0
func Flush()
Flush drains the external log writer when one is configured. A no-op otherwise.
func GetLogger ¶
GetLogger returns the configured logger instance Use this when passing to libraries
func Local ¶ added in v0.42.0
Local is the logger without what Tee added: for the code that delivers the copies, which would otherwise copy its own complaints about failing to deliver them, without end.
func Pipeline ¶ added in v0.33.0
Pipeline emits a record that must reach the external logging service regardless of log.level — audit events, forwarded space logs, tunnel requests. Level filtering is for server diagnostics; these are data the operator asked to be delivered.
func Tee ¶ added in v0.42.0
Tee has a copy of every record the logger takes at or above the configured level sent to l too: a space's agent copies its records to the space's log. Every logger the package gives copies, whenever it was taken, with its fields and group. A later Tee replaces the copy; Tee(nil) stops it.
Types ¶
This section is empty.