loggingx

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 15

Documentation

Overview

Package loggingx provides shared functions to initialize logging and reduce code duplication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(appName string, cfg Config) *zap.SugaredLogger

InitLogger returns a logger based on the config

func MustViperFlags

func MustViperFlags(v *viper.Viper, flags *pflag.FlagSet)

MustViperFlags returns the cobra flags and viper config to prevent code duplication and help provide consistent flags across the applications

Types

type Config

type Config struct {
	Debug  bool `mapstructure:"debug"`
	Pretty bool `mapstructure:"pretty"`
}

Config handles reading in all the config values available for setting up a logger

Jump to

Keyboard shortcuts

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