zaplog

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package zaplog uses the zap logging library for application logs. There are two logging modes, development and production. The production mode saves the logs to file and automatically rotates older files. While the development mode prints all feedback to stdout.

Index

Constants

View Source
const (
	// ServerLog is the filename of the Error, Panic and Fatal level log.
	ServerLog = "defacto2_server_panics.log"
	// InfoLog is the filename of the Warn and Info level log.
	InfoLog = "defacto2_server_info.log"
	// MaxSizeMB is the maximum file size in megabytes before a log rotation is triggered.
	MaxSizeMB = 100
	// MaxBackups is the maximum number of rotated logs to keep, older logs are deleted.
	MaxBackups = 5
	// MaxDays is the maximum days a log is kept before a log rotation.
	MaxDays = 45
)

Variables

This section is empty.

Functions

func Debug

func Debug() *zap.Logger

Debug logger prints all log levels to stdout.

func Status

func Status() *zap.Logger

Status logger prints all log levels to stdout but without callers.

func Store

func Store(absPath string) *zap.Logger

Store logger prints all info and higher log levels to files. Fatal and Panics are also returned to os.Stderr.

func Timestamp

func Timestamp() *zap.Logger

Timestamp logger prints all log levels to stdout but without callers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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