logging

package
v0.0.0-...-2758cc9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TextLogType defines a TextFormatter logger.
	TextLogType = "text"
	// JSONLogType defines a JSONFormatter logger.
	JSONLogType = "json"
)
View Source
const (
	// DefaultTimestampFormat defines the default time format of the timestamps.
	DefaultTimestampFormat = "2006-01-02 15:04:05"
	// DefaultLogFilename defines the default name of the log file.
	DefaultLogFilename = "log.log"
)

Variables

This section is empty.

Functions

func Configure

func Configure(config *Config)

Configure configures the logging.

func ConfigureDefault

func ConfigureDefault()

ConfigureDefault configures the logging with the default values.

Types

type Config

type Config struct {
	DefaultLogger *LogConfig `json:"defaultLogger" binding:"optional"`
}

Config denotes the configuration of the logging.

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a default logging configuration.

type LogConfig

type LogConfig struct {
	Type                      string         `json:"type" binding:"required"`
	TimestampFormat           string         `json:"timestampFormat" binding:"optional"`
	DisableFullTimestamp      bool           `json:"disableFullTimestamp" binding:"optional"`
	DisableColors             bool           `json:"disableColors" binding:"optional"`
	EnableFunctionNameLogging bool           `json:"enabledFunctionNameLogging" binding:"optional"`
	LogFile                   *LogFileConfig `json:"logFile" binding:"optional"`
}

LogConfig denotes the configuration of the loggers.

type LogFileConfig

type LogFileConfig struct {
	Path     string `json:"path" binding:"required"`
	Filename string `json:"filename" binding:"required"`
}

LogFileConfig denotes the configuration of the log file.

Jump to

Keyboard shortcuts

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