Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultLevelMapping = 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.Alert, zerolog.NoLevel: logging.Default, zerolog.TraceLevel: logging.Default, }
Functions ¶
func Close ¶
func Close()
Close waits for all opened loggers for all clients to be flushed. Once flushed, the client is then closed as well.
func NewWriter ¶
func NewWriter(ctx context.Context, parent, logID string, opts ...logging.LoggerOption) (zerolog.LevelWriter, error)
NewWriter creates a LevelWriter that logs only to GCP Cloud Logging using non-blocking calls. Writer is created using default client options. Once logging.Client is created, NewWriter will execute logging.Client.Ping to ensure application can use GCP Cloud Logging. If a specific logging client is needed, use NewWriterWithClient instead.
func NewWriterWithClient ¶
func NewWriterWithClient(client *logging.Client, logID string, opts ...logging.LoggerOption) (zerolog.LevelWriter, error)
NewWriterWithClient instantiates a logging.Logger that will write entries with the given log ID, such as "syslog". A log ID must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters: [A-Za-z0-9]; and punctuation characters: forward-slash, underscore, hyphen, and period.
Types ¶
This section is empty.