internallogger

package
v0.0.0-...-5dd924d Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package internallogger provides a customized logging utility built on top of Uber's zap library. It also integrates with the service's internal context to automatically extract and log mutable fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogField

type LogField map[string]interface{}

LogField represents a custom map type for log fields.

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger encapsulates an instance of zap's logger with custom functionalities.

func NewLogger

func NewLogger() (*Logger, error)

NewLogger initializes and returns a new instance of Logger with predefined configurations.

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, msg string, fields ...map[string]interface{})

Error logs an error message and extracts additional fields from the context, if present.

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, msg string, fields ...map[string]interface{})

Info logs an informational message and extracts additional fields from the context, if present.

func (*Logger) SetCore

func (l *Logger) SetCore(core zapcore.Core)

SetCore updates the logger's core, useful for testing and custom configurations.

Jump to

Keyboard shortcuts

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