standardlogger

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package standardlogger provides a zap-based logging implementation with structured, leveled logging, including support for panic handling and configurable log levels through the StandardLog type and associated functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCore

func GetCore(l *StandardLog) zapcore.Core

func GetLabelsAsZapFields

func GetLabelsAsZapFields(labels logger.Labels) []zap.Field

func GetLabelsKeys

func GetLabelsKeys(labels logger.Labels) []string

func GetLoggerFieldsAsZapFields

func GetLoggerFieldsAsZapFields(loggerFields logger.Fields) []zap.Field

func New

func New(labels logger.Labels, opts ...Option) logger.Log

Types

type Option

type Option func(*loggerSettings)

func WithLogLevel

func WithLogLevel(logLevel logger.Level) Option

WithLogLevel returns Option that sets the desired log level.

type PanicContainer

type PanicContainer struct {
	Code uint64
	// contains filtered or unexported fields
}

type StandardLog

type StandardLog struct {
	ZapLogger zapLogger
}

func (*StandardLog) Close

func (l *StandardLog) Close()

func (*StandardLog) Error

func (l *StandardLog) Error(msg string, code uint64)

func (*StandardLog) Errorw

func (l *StandardLog) Errorw(msg string, code uint64, fields logger.Fields)

func (*StandardLog) Fatal

func (l *StandardLog) Fatal(msg string, code uint64)

func (*StandardLog) Fatalw

func (l *StandardLog) Fatalw(msg string, code uint64, fields logger.Fields)

func (*StandardLog) Flush

func (l *StandardLog) Flush()

func (*StandardLog) Info

func (l *StandardLog) Info(msg string)

func (*StandardLog) Infow

func (l *StandardLog) Infow(msg string, fields logger.Fields)

func (*StandardLog) Panic

func (l *StandardLog) Panic(msg string, code uint64)

func (*StandardLog) PanicLogger

func (l *StandardLog) PanicLogger()

func (*StandardLog) Panicw

func (l *StandardLog) Panicw(msg string, code uint64, fields logger.Fields)

func (*StandardLog) Warn

func (l *StandardLog) Warn(msg string)

func (*StandardLog) Warnw

func (l *StandardLog) Warnw(msg string, fields logger.Fields)

Jump to

Keyboard shortcuts

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