logging

package
v0.0.0-...-ad947ae Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG   = "debug"
	INFO    = "info"
	WARNING = "warning"
	ERROR   = "error"
)

Variables

Functions

func CheckLogLevel

func CheckLogLevel(lv string) bool

func GetAllLogLevelsString

func GetAllLogLevelsString(sep string) string

func GetJsonFormat

func GetJsonFormat() *myLogger.JSONFormatter

func GetLogrusLogLevel

func GetLogrusLogLevel(lv string) myLogger.Level

func GetTextFormat

func GetTextFormat() *myLogger.TextFormatter

func NewRawLogger

func NewRawLogger(lv string) *myLogger.Logger

func SetLogLevel

func SetLogLevel(lg *myLogger.Logger, lv string)

func WriteLogOnlyMsg

func WriteLogOnlyMsg(logWr *myLogger.Logger, msg string, level string)

func WriteToLog

func WriteToLog(logWr *myLogger.Logger, fields myLogger.Fields, msg string, level string)

func WriteToLogNoExtraMsg

func WriteToLogNoExtraMsg(logWr *myLogger.Logger, fields myLogger.Fields, level string)

Types

type LogConf

type LogConf struct {
	LogFile   string `mapstructure:"logfile"`
	LogLevel  string `mapstructure:"loglevel"`
	LogFormat string `mapstructure:"logformat"`
}

func (*LogConf) CreateNewLogger

func (logCf *LogConf) CreateNewLogger() *myLogger.Logger

logFile: full path of log file. default, os.Stdout is used logLevel: debug, info, warning, error. default warning is used format: json, text

Jump to

Keyboard shortcuts

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