xlog

package
v0.0.0-...-4cf0c03 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFile        = "default.log"
	DefaultPath        = "logs/"
	DefaultStdout      = true
	DefaultLevel       = "debug"
	DefaultRotateTime  = 24
	DefaultRotateLimit = 7
)

Variables

This section is empty.

Functions

func DefaultLogger

func DefaultLogger() logr.Logger

DefaultLogger returns the default logger.

func Init

func Init(cfg *Config) error

func New

func New(cfg *Config) (logr.Logger, error)

func SetDefaultLogger

func SetDefaultLogger(l logr.Logger)

SetDefaultLogger sets the default logger for package log.

Types

type Config

type Config struct {
	Path        string `json:"path"`
	File        string `json:"file"`
	Level       string `json:"level"`
	Stdout      bool   `json:"stdout"`
	RotateTime  int    `json:"rotateTime"`
	RotateLimit uint   `json:"rotateLimit"`
}

func NewDefaultConfig

func NewDefaultConfig() *Config

Jump to

Keyboard shortcuts

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