provider

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressProvider

func CompressProvider(provider writer.Provider, options ...writer.CompressOption) writer.Provider

CompressProvider will decorate writer.Provider with compression

func LogFileProvider

func LogFileProvider(name string, format string, timeFormat string) writer.Provider

LogFileProvider creates one static file with the given name and format if the file name already exists, it renames it with the time and create a new static file

ex: LogFileProvider("dev", os.TempDir()+"/my_app_%s.log", "2006-01-02") will create a file named "/tmp/my_app_dev.log" and each time the provider is called, it will backup the current "/tmp/dev.log" to "/tmp/my_app_2006-01-02.log"

func TimeFileProvider

func TimeFileProvider(fileNameFormat string, timeFormat string) writer.Provider

TimeFileProvider provide a new file (io.Writer) having named with a given filename format ex: `provider.TimeFileProvider("fake_format_%s", "2006-01-02")` will create a file named "fake_format_2019-08-17" (i.e fake_format_<ISO_8601_DATE>)

Types

This section is empty.

Jump to

Keyboard shortcuts

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