zr

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

ZR

GitHub GitHub go.mod Go version Codecov branch CodeFactor Grade GitHub issues Go Report

What is zr ?

zr is a library for configuring easyly a zerolog logger with backends for hot reloading.

Documentation

See the documentation for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Done

func Done()

func Setup

func Setup(opts ...ExtraZrOptions) error

Setup is a constructor for zr. It takes a list of options which can be used to customize the zr. Available options are:

WithCustomLevel(level string)
WithCustomFormat

Default values are:

level: info
format: json

Types

type ExtraZrOptions

type ExtraZrOptions func(*zr)

func WithCustomFormat

func WithCustomFormat(format FormatsOptions) ExtraZrOptions

WithCustomFormat is an option which sets up the custom log format. zr is called on for custom log format. Allowed format are json and human. if this option is not used the log level is json.

func WithCustomHotReload

func WithCustomHotReload(opts ...hr.ExtraHotReloadOptions) ExtraZrOptions

WithCustomHotReload is an option which sets up the custom hot reload. zr is called on for custom hot reload.

func WithCustomLevel

func WithCustomLevel(level LevelsOptions) ExtraZrOptions

WithCustomLevel is an option which sets up the custom log level. zr is called on for custom log level. if this option is not used the log level is info.

type FormatsOptions

type FormatsOptions func(*zr)

func FormatHuman

func FormatHuman() FormatsOptions

FormatHuman is an option which sets up the human log format.

func FormatJSON

func FormatJSON() FormatsOptions

FormatJSON is an option which sets up the json log format.

type LevelsOptions

type LevelsOptions func(*zr)

func LevelDebug

func LevelDebug() LevelsOptions

LevelDebug is a helper function which sets the log level to debug.

func LevelError

func LevelError() LevelsOptions

LevelError is a helper function which sets the log level to error.

func LevelFatal

func LevelFatal() LevelsOptions

LevelFatal is a helper function which sets the log level to fatal.

func LevelInfo

func LevelInfo() LevelsOptions

LevelInfo is a helper function which sets the log level to info.

func LevelPanic

func LevelPanic() LevelsOptions

LevelPanic is a helper function which sets the log level to panic.

func LevelTrace

func LevelTrace() LevelsOptions

LevelTrace is a helper function which sets the log level to trace.

func LevelWarn

func LevelWarn() LevelsOptions

LevelWarning is a helper function which sets the log level to warning.

Directories

Path Synopsis
examples
pkg
mocks
* Copyright 2019-present Open Networking Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019-present Open Networking Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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