logger

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: BSD-1-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package logger defines facilities to write bot data to log files, along with code which cycles log cycles and purges log files when needed.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Format defines the date layout for log file names.
	Format = "20060102"

	// PurgeTimeout defines the timeout after which the bot should
	// check for stale log files.
	PurgeTimeout = time.Hour * 24

	// RefreshTimeout determines how often we should check if a new
	// log file should be opened.
	RefreshTimeout = time.Minute

	// Expiration defines how old a log file should be, before it
	// is considered stale.
	Expiration = time.Hour * 24 * 7 * 2
)

Functions

func Init

func Init(dir string)

Init initializes a new log file, if necessary. It then launches a background service which periodically checks if a new log file should be created. This happens according to a predefined timeout. Additionally, it will periodically purge stale log files from disk.

func Shutdown

func Shutdown()

Shutdown shuts down the background log operations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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