Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSeverityMap = map[zerolog.Level]logging.Severity{ zerolog.DebugLevel: logging.Debug, zerolog.InfoLevel: logging.Info, zerolog.WarnLevel: logging.Warning, zerolog.ErrorLevel: logging.Error, zerolog.PanicLevel: logging.Critical, zerolog.FatalLevel: logging.Critical, }
DefaultSeverityMap contains the default zerolog.Level -> logging.Severity mappings.
Functions ¶
func NewCloudLoggingWriter ¶
func NewCloudLoggingWriter(ctx context.Context, projectID, logID string, opts CloudLoggingOptions) (writer zerolog.LevelWriter, err error)
NewCloudLoggingWriter creates a LevelWriter that logs only to GCP Cloud Logging using non-blocking calls.
Types ¶
type CloudLoggingOptions ¶
type CloudLoggingOptions struct { // SeverityMap can be optionally specified to use instead of DefaultSeverityMap. SeverityMap map[zerolog.Level]logging.Severity // Logger can be optionally provided in lieu of constructing a logger on the caller's behalf. Logger *logging.Logger // LoggerOptions is optionally used to construct a Logger. LoggerOptions []logging.LoggerOption }
CloudLoggingOptions specifies some optional configuration.
Click to show internal directories.
Click to hide internal directories.