logger

package
v0.20.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package logger has helpers to setup a zerolog.Logger

https://github.com/rs/zerolog

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(w io.Writer, withTimestamp bool) zerolog.Logger

NewLogger is a convenience function to initialize a zerolog.Logger

func WriteErrorStackGlobal

func WriteErrorStackGlobal(i bool)

WriteErrorStackGlobal is a convenience wrapper to set the zerolog Global variable ErrorStackMarshaler to write Error stacks for logs

Types

type GCPSeverityHook

type GCPSeverityHook struct{}

The GCPSeverityHook struct satisfies the zerolog.Hook interface as it has the Run method defined with the appropriate parameters

func (GCPSeverityHook) Run

func (h GCPSeverityHook) Run(e *zerolog.Event, level zerolog.Level, msg string)

Run method satisfies zerolog.Hook interface and adds a severity level to all logs, given zerolog.Level passed in. Zerolog levels are mapped to log levels recognized by GCP

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL