logging

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logging provides a configurable logger for the server.

Index

Constants

View Source
const TimeLayout = "2006-01-02T15:04:05.000Z"

TimeLayout is the default time layout for the logger.

Variables

This section is empty.

Functions

func MustNew

func MustNew(options ...Option) zerolog.Logger

MustNew initializes a new logger with the specified options. It panics if there is an error.

func New

func New(options ...Option) (zerolog.Logger, error)

New initializes a new logger with the specified options.

Types

type Option

type Option func(*options)

Option is a function that sets an option for the logger.

func WithConsoleLog

func WithConsoleLog(enabled bool) Option

WithConsoleLog enables or disables console logging.

func WithFileName

func WithFileName(logFileName string) Option

WithFileName sets the log file name.

func WithLevel

func WithLevel(logLevelInput string) Option

WithLevel sets the log level.

func WithSoleWriter

func WithSoleWriter(writer io.Writer) Option

WithSoleWriter sets the sole writer to use for logging. This is useful for testing logging output.

func WithWriters

func WithWriters(writers ...io.Writer) Option

WithWriters sets adds additional writers to use for logging. This is useful for testing logging output.

Jump to

Keyboard shortcuts

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