logger

package
v0.34.0-test1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCore

func NewCore(conf Config) (zapcore.Core, error)

func OpenFile

func OpenFile(path string, mode FileMode) (zapcore.WriteSyncer, error)

Types

type Config

type Config struct {
	Path string `yaml:"path"`
	// If Path is a file, Mode will determine how the log file is managed.
	// FileModeAppend is the default if value is undefined.
	Mode  FileMode      `yaml:"mode,omitempty"`
	Level zapcore.Level `yaml:"level"`
}

type FileMode

type FileMode string
const (
	// FileModeAppend will append to existing log files between restarts.
	// This is the default option.
	FileModeAppend FileMode = "append"
	// FileModeTruncate will truncate onto existing log files in between
	// restarts.
	FileModeTruncate FileMode = "truncate"
	// FileModeRotate will enable log rotation for log files.
	FileModeRotate FileMode = "rotate"
)

func (*FileMode) Set

func (m *FileMode) Set(s string) error

func (FileMode) String

func (m FileMode) String() string

Jump to

Keyboard shortcuts

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