Documentation ¶
Overview ¶
Package cloudslog provides primitives for structured logging with the standard library log/slog package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(config LoggerConfig) slog.Handler
NewHandler creates a new slog.Handler with special-handling for Cloud Run.
Types ¶
type LoggerConfig ¶
type LoggerConfig struct { // Development indicates if the logger should output human-readable output for development. Development bool `default:"true" onGCE:"false"` // Level indicates which log level the logger should output at. Level slog.Level `default:"debug" onGCE:"info"` // ProtoMessageSizeLimit is the maximum size, in bytes, of requests and responses to log. // Messages large than the limit will be truncated. // Default value, 0, means that no messages will be truncated. ProtoMessageSizeLimit int `onGCE:"1024"` }
LoggerConfig configures the application logger.
Click to show internal directories.
Click to hide internal directories.