logger

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

README

بِسْمِ اللّٰهِ الرَّحْمٰنِ الرَّحِيْمِ


السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ


ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ


اللَّهُمَّ صَلِّ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا صَلَّيْتَ عَلَى إِبْرَاهِيمَ وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ ، اللَّهُمَّ بَارِكْ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا بَارَكْتَ عَلَى إِبْرَاهِيمَ ، وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ

logger

Logger is a package that wraps go.uber.org/zap.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyOpts = errors.New("Options must not be nil or empty")
)

List of all errors used in this package

Functions

func Check

func Check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry

Check returns a CheckedEntry if logging a message at the specified level is enabled.

func DPanic

func DPanic(msg string, fields ...zap.Field)

DPanic logs message at DPanic level. If logger is in the development mode, the logger will be panic.

func Debug

func Debug(msg string, fields ...zap.Field)

Debug logs message at Debug level.

func Error

func Error(msg string, fields ...zap.Field)

Error logs message at Error level.

func Fatal

func Fatal(msg string, fields ...zap.Field)

Fatal logs message at Fatal level.

func Info

func Info(msg string, fields ...zap.Field)

Info logs message at Info level.

func Init

func Init(opts ...Options) (err error)

Init initialize the logger local instance of this package.

func Named

func Named(s string) *zap.Logger

Named adds a new path segment to the logger's name.

func Panic

func Panic(msg string, fields ...zap.Field)

Panic logs message at Panic level.

func Sugar

func Sugar() *zap.SugaredLogger

Sugar returns the sugared logger.

func Sync

func Sync() error

Sync flushes the buffer/resources inside the logger.

func Warn

func Warn(msg string, fields ...zap.Field)

Warn logs message at Warn level.

func With

func With(fields ...zap.Field) *zap.Logger

With creates a child logger and adds structured context to it.

func WithOptions

func WithOptions(options ...zap.Option) *zap.Logger

WithOptions clones the current logger and supplies it with options.

Types

type Logger

type Logger struct {
	*zap.Logger
	Core    zapcore.Core
	Options []zap.Option
}

Logger specifies the logger instance for this package.

func Get

func Get() *Logger

Get returns the underlying logger

func (*Logger) Validate

func (l *Logger) Validate() (err error)

Validate validate the logger parameters that is required.

type Options

type Options func(inst *Logger)

Options specifies the functional options to be used for the init of this package.

func WithCore

func WithCore(core zapcore.Core) Options

WithCore supply the Core to the underlying Logger.

func WithZapOptions

func WithZapOptions(options []zap.Option) Options

WithZapOptions supplies the slice of zap.Option to the underlying Logger.

Jump to

Keyboard shortcuts

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