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 Flush ¶ added in v0.2.0
func Flush() []error
Flush blocks while flushing all loggers this module created.
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 { // Specify this to override DefaultSeverityMap. SeverityMap map[zerolog.Level]logging.Severity // Used during *logging.Client construction. ClientOptions []option.ClientOption // Used during *logging.Client construction. ClientOnError func(error) // Specify this to override the default of constructing a *logging.Logger on the caller's behalf. Logger *logging.Logger // Used during GCP Logger construction. LoggerOptions []logging.LoggerOption }
CloudLoggingOptions specifies some optional configuration.
Click to show internal directories.
Click to hide internal directories.