logger

package
v0.0.0-...-d015374 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

View Source
const (
	JSONFormat = "json"
	TextFormat = "text"
)

The log format can either be text or JSON.

View Source
const (
	NamedFxSetupConfig = "logger.FxSetupConfig"
	NamedConfig        = "logger.Config"
)

Variables

View Source
var (
	DefaultConfig = &Config{
		Level:  "info",
		Format: JSONFormat,
		Caller: false,
	}

	DebugTextConfig = &Config{
		Level:  "debug",
		Format: TextFormat,
		Caller: true,
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Level  string `default:"info"`
	Format string `default:"json"`
	Caller bool   `default:"false"`
}

Config stores the config for the logger.

func (*Config) WithCaller

func (c *Config) WithCaller(caller bool) *Config

WithCaller returns a new config with overridden value.

func (*Config) WithFormatJSON

func (c *Config) WithFormatJSON() *Config

WithFormat returns a new config with overridden value.

func (*Config) WithFormatText

func (c *Config) WithFormatText() *Config

WithFormat returns a new config with overridden value.

func (*Config) WithLevel

func (c *Config) WithLevel(level string) *Config

WithLevel returns a new config with overridden value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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