golog

package module
v0.0.0-...-2895439 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 7 Imported by: 112

README

golog

Sugar on top of the already sweet zap library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDebugLoggerConfig

func NewDebugLoggerConfig() zap.Config

NewDebugLoggerConfig returns a new default development logger config.

func NewDevelopmentLoggerConfig

func NewDevelopmentLoggerConfig() zap.Config

NewDevelopmentLoggerConfig returns a new default development logger config.

func NewLoggerConfigForGCP

func NewLoggerConfigForGCP() zap.Config

NewLoggerConfigForGCP returns a new default production configuration for GCP.

func NewProductionLoggerConfig

func NewProductionLoggerConfig() zap.Config

NewProductionLoggerConfig returns a new default production configuration.

func ReplaceGloabl

func ReplaceGloabl(logger Logger) func()

ReplaceGloabl replaces the global loggers and returns a function to reset the loggers to the previous state.

Types

type Logger

type Logger = *zap.SugaredLogger

func Global

func Global() Logger

Global returns the global logger

func NewDebugLogger

func NewDebugLogger(name string) Logger

NewDevelopmentLogger returns a new logger using the default development configuration.

func NewDevelopmentLogger

func NewDevelopmentLogger(name string) Logger

NewDevelopmentLogger returns a new logger using the default development configuration.

func NewLogger

func NewLogger(name string) Logger

NewLogger returns a new logger using the default production configuration.

func NewLoggerForGCP

func NewLoggerForGCP(name string) Logger

NewLoggerForGCP returns a new logger using the default production configuration.

func NewObservedTestLogger

func NewObservedTestLogger(tb testing.TB) (Logger, *observer.ObservedLogs)

NewObservedTestLogger is like NewTestLogger but also saves logs to an in memory observer.

func NewTestLogger

func NewTestLogger(tb testing.TB) Logger

NewTestLogger directs logs to the go test logger.

Directories

Path Synopsis
Package gcpcore is a custom zap.Core that formats Error logs for GCP Error Reporting
Package gcpcore is a custom zap.Core that formats Error logs for GCP Error Reporting

Jump to

Keyboard shortcuts

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