logging

package
v0.0.1-0...-8535732 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package logging provides wrappers around zap logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment int

Environment enumerates predefined logging configurations.

const (
	// ProductionLogger is a short hand for predefined logging configuration for production use.
	ProductionLogger Environment = iota
	// DevelopmentLogger is a short hand for predefined logging configuration for development use.
	DevelopmentLogger
)

type LogLevel

type LogLevel int

LogLevel enumerates log levels

const (
	// DEBUG is the equivalent of zap.DebugLevel
	DEBUG LogLevel = iota

	// INFO is the equivalent of zap.InfoLevel
	INFO

	// WARN is the equivalent of zap.WarnLevel
	WARN

	// ERROR is the equivalent of zap.ErrorLevel
	ERROR
)

type Logger

type Logger struct {
	*zap.SugaredLogger
}

Logger wraps a zap.SugaredLogger.

func CreateDevelopmentLogger

func CreateDevelopmentLogger() *Logger

CreateDevelopmentLogger creates a new development logger.

func CreateProductionLogger

func CreateProductionLogger() *Logger

CreateProductionLogger creates a new production logger.

func (*Logger) AuditLog

func (l *Logger) AuditLog(logLevel LogLevel, phase string, msg string, keysAndValues ...interface{})

AuditLog is a prepared wrapper to harmonize the audit logging format.

func (*Logger) Log

func (l *Logger) Log(logLevel LogLevel, msg string, keysAndValues ...interface{})

Log is a prepared wrapper to harmonize the logging entrypoint.

Jump to

Keyboard shortcuts

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