loggergo

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 7

README

loggergo

GitHub tag (with filter) Go Reference Maintainability

Logging library I've come up with in order unify way my apps implement logging.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggerInit

func LoggerInit(config LoggerGoConfig, additionalAttrs ...any) (*slog.Logger, error)

The LoggerInit function initializes a logger with the provided configuration and additional attributes.

Types

type LoggerGoConfig

type LoggerGoConfig struct {
	Level  string `json:"level"`
	Format string `json:"format"`
	Dev    bool   `json:"dev"`
}

The LoggerGoConfig type is a configuration struct for a logger in Go, with fields for level, format, and dev mode. @property {string} Level - The "Level" property in the LoggerGoConfig struct represents the logging level. It determines the severity of the log messages that will be recorded. Common levels include "debug", "info", "warning", "error", and "fatal". @property {string} Format - The `Format` property in the `LoggerGoConfig` struct represents the desired format for the log messages. It specifies how the log messages should be formatted when they are written to the log output. @property {bool} Dev - The `Dev` property is a boolean flag that indicates whether the logger is running in development mode or not. It can be used to enable or disable certain logging features or behaviors specific to development environments.

Jump to

Keyboard shortcuts

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