rotate

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Overview

Package rotate provides an io.Writer that changes the file it writes to based on the current date. It always writes to a file inside of the directory it is given, and only switches files once it has finished writing a line and the date has changed. It is intended to be used with log.SetOutput().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(directory string) (io.WriteCloser, error)

New returns a new logger that will always log to directory/YYYY-MM-DD.log. When its close method is called, it will close any open file and stop accepting calls to Write. A closed logger may not be re-opened.

Types

This section is empty.

Jump to

Keyboard shortcuts

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