logger

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package logger implements a logger that uses the zap library.

It provides a type ZapLogger that implements the logger.ILogger interface. It also provides a function NewZapLogger() that returns a new ZapLogger.

The ZapLogger has 3 methods: Info, Warning, and Error. Each of these methods logs a message at a different level of severity.

The Info method logs a message at the INFO level of severity. The Warning method logs a message at the WARNING level of severity. The Error method logs a message at the ERROR level of severity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ILogger

type ILogger interface {
	// Info logs informational messages.
	Info(string, ...interface{})
	// Warning logs warning messages.
	Warning(string, ...interface{})
	// Error logs error messages.
	Error(string, ...interface{})
}

ILogger defines an interface for logging with different levels of severity.

type ZapLogger

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

ZapLogger is a logger that uses the zap library.

func NewZapLogger

func NewZapLogger() ZapLogger

NewZapLogger returns a new ZapLogger.

func (*ZapLogger) Error

func (zl *ZapLogger) Error(message string, fields ...interface{})

Error logs a message at the ERROR level of severity.

func (*ZapLogger) Info

func (zl *ZapLogger) Info(message string, fields ...interface{})

Info logs a message at the INFO level of severity.

func (*ZapLogger) Warning

func (zl *ZapLogger) Warning(message string, fields ...interface{})

Warning logs a message at the WARNING level of severity.

type ZeroLog

type ZeroLog struct {
}

ZeroLog is a logger that uses the zerolog library.

func NewZeroLog

func NewZeroLog() ZeroLog

NewZeroLog returns a new ZeroLog.

func (*ZeroLog) Error

func (zl *ZeroLog) Error(message string, fields ...interface{})

Error logs a message at the ERROR level of severity.

func (*ZeroLog) Info

func (zl *ZeroLog) Info(message string, fields ...interface{})

Info logs a message at the INFO level of severity.

func (*ZeroLog) Warning

func (zl *ZeroLog) Warning(message string, fields ...interface{})

Warning logs a message at the WARNING level of severity.

Jump to

Keyboard shortcuts

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