gologfile

package module
v0.0.0-...-f1ec650 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GoLogFile

gologfile — file adapter for golog

Installation

$ go get github.com/memUsins/gologfile

Usage

// simple
logger := golog.NewLogger(gologfile.NewDefaultFileAdapterWithLevel(golog.ErrorLevel))

// with default config
logger := golog.NewLogger(gologfile.NewDefaultFileAdapter())

// with custom config
logger := golog.NewLogger(gologfile.NewFileAdapter(&gologfile.FileConfig{
	Enable: true, 
	Level: golog.ErrorLevel,
	LJLogger: &lumberjack.Logger{
		Filename:   "logs/error.log", 
		MaxSize:    10, 
		MaxBackups: 3, 
		MaxAge:     28, 
		LocalTime:  false,
		Compress:   false,
	},
}))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileAdapter

type FileAdapter interface {
	golog.Adapter
}

func NewDefaultFileAdapter

func NewDefaultFileAdapter() FileAdapter

NewDefaultFileAdapter returns new FileAdapter with default config

func NewDefaultFileAdapterWithLevel

func NewDefaultFileAdapterWithLevel(level golog.Level) FileAdapter

NewDefaultFileAdapterWithLevel returns new FileAdapter with default config and target level

func NewFileAdapter

func NewFileAdapter(cfg *FileConfig) FileAdapter

NewFileAdapter returns new FileAdapter

type FileConfig

type FileConfig struct {
	Enable bool

	Level    golog.Level
	LJLogger *lumberjack.Logger
}

FileConfig core config for adapter

Jump to

Keyboard shortcuts

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