Categorygithub.com/gopi-frame/logger
modulepackage
0.0.0-20241127091016-038924c405be
Repository: https://github.com/gopi-frame/logger.git
Documentation: pkg.go.dev

# README

Logger

Go Reference Go codecov Go Report Card License: MIT FOSSA Status

Package logger is a package for managing logger drivers and creating logger instances.

Installation

go get -u github.com/gopi-frame/logger

Import

import "github.com/gopi-frame/logger"

Usage

package main

import (
	"github.com/gopi-frame/logger"
	
	_ "github.com/gopi-frame/logger/driver/zap"
)

func main() {
	log, err := logger.Open("zap", map[string]any{
		"Level": "debug",
    })
}

Drivers

How to create a custom driver

To create a custom driver, just implement the logger.Driver interface and register it using logger.Register

License

FOSSA Status

# Packages

No description provided by the author

# Functions

No description provided by the author
Drivers returns a list of registered logger drivers.
GetValue returns the value stored in ctx, if any.
No description provided by the author
NewDeferLogger create a defer logger.
NewLoggerManager creates a new logger manager.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Open opens a new logger using the given driver name and options.
Register registers a new logger driver.
No description provided by the author
WithValue returns a new context that carries value.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

DeferLogger defer logger.
LoggerManager is a logger manager and a proxy for the default logger.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author