logger

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Package logger provides a convenience method for setting up rs/zerolog and returning a logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *zerolog.Logger

Get a reference to the zerolog.Logger with the appropriate configured settings.

Types

type Logger

type Logger struct {
	LogFile     string `json:"log_file"`  // Full path and filename of log file; required by LogToFile
	LogLevel    string `json:"log_level"` // One of rs/zerolog support log levels: trace, debug, etc
	LogToStdout bool   `json:"to_stdout"` // Log to STDOUT
	LogToStderr bool   `json:"to_stderr"` // Log to STERR
	LogToFile   bool   `json:"to_file"`   // Enable logging to file; requires that LogFile is set.
}

Logger contains all potential settings available for setting up the rs/zerolog instance

func (*Logger) Initialize

func (l *Logger) Initialize()

Initialize uses the configuration info in the Logger struct to set up the rs/zerolog instance

Jump to

Keyboard shortcuts

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