Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLogLevel(lv string) bool
- func GetAllLogLevelsString(sep string) string
- func GetJsonFormat() *myLogger.JSONFormatter
- func GetLogrusLogLevel(lv string) myLogger.Level
- func GetTextFormat() *myLogger.TextFormatter
- func NewRawLogger(lv string) *myLogger.Logger
- func SetLogLevel(lg *myLogger.Logger, lv string)
- func WriteLogOnlyMsg(logWr *myLogger.Logger, msg string, level string)
- func WriteToLog(logWr *myLogger.Logger, fields myLogger.Fields, msg string, level string)
- func WriteToLogNoExtraMsg(logWr *myLogger.Logger, fields myLogger.Fields, level string)
- type LogConf
- type MyLog
- func (this *MyLog) CreateNewRawLogger()
- func (this *MyLog) ExitProgram(errcode int, msg string)
- func (this *MyLog) GenLogFields(msg string, errCode int) map[string]interface{}
- func (this *MyLog) SetLogConf()
- func (this *MyLog) WriteToLogByFields(msgMap map[string]interface{}, level string, iflogStack bool, exitCode int, ...)
- func (this *MyLog) WriteToLogByFieldsError(err error, extMsg string, level string, ifStack bool, errCode int, ifExit bool)
- func (this *MyLog) WriteToLogByFieldsErrorExit(err error, level string, errCode int)
- func (this *MyLog) WriteToLogByFieldsErrorExtramsg(err error, extMsg string, level string)
- func (this *MyLog) WriteToLogByFieldsErrorExtramsgExit(err error, extMsg string, level string, errCode int)
- func (this *MyLog) WriteToLogByFieldsErrorExtramsgExitCode(err error, extMsg string, level string, exitCode int)
- func (this *MyLog) WriteToLogByFieldsErrorExtramsgStack(err error, extMsg string, level string)
- func (this *MyLog) WriteToLogByFieldsErrorExtramsgStackExit(err error, extMsg string, level string, errCode int)
- func (this *MyLog) WriteToLogByFieldsErrorNormal(err error, level string)
- func (this *MyLog) WriteToLogByFieldsErrorStack(err error, level string)
- func (this *MyLog) WriteToLogByFieldsErrorStackExit(err error, level string, errCode int)
- func (this *MyLog) WriteToLogByFieldsExit(msgMap map[string]interface{}, level string, exitCode int)
- func (this *MyLog) WriteToLogByFieldsExitMsgNoErr(msg string, level string, exitCode int)
- func (this *MyLog) WriteToLogByFieldsExitMsgNoErrStack(msg string, level string, exitCode int)
- func (this *MyLog) WriteToLogByFieldsNormal(msgMap map[string]interface{}, level string)
- func (this *MyLog) WriteToLogByFieldsNormalOnlyMsg(msg string, level string)
- func (this *MyLog) WriteToLogByFieldsNormalOnlyMsgExitCode(msg string, level string, exitCode int)
- func (this *MyLog) WriteToLogByFieldsNormalOnlyMsgStack(msg string, level string)
- func (this *MyLog) WriteToLogByFieldsStack(msgMap map[string]interface{}, level string)
- func (this *MyLog) WriteToLogByFieldsStackExit(msgMap map[string]interface{}, level string, exitCode int)
- func (this *MyLog) WriteToLogByMsg(msg string, level string, iflogStack bool, exitCode int, ifExitProgram bool)
- func (this *MyLog) WriteToLogByMsgExit(msg string, level string, exitCode int)
- func (this *MyLog) WriteToLogByMsgNormal(msg string, level string)
- func (this *MyLog) WriteToLogByMsgStack(msg string, level string)
- func (this *MyLog) WriteToLogByMsgStackExit(msg string, level string, exitCode int)
Constants ¶
View Source
const ( DEBUG = "debug" INFO = "info" WARNING = "warning" ERROR = "error" )
Variables ¶
Functions ¶
func CheckLogLevel ¶
func GetAllLogLevelsString ¶
func GetJsonFormat ¶
func GetJsonFormat() *myLogger.JSONFormatter
func GetLogrusLogLevel ¶
func GetTextFormat ¶
func GetTextFormat() *myLogger.TextFormatter
func NewRawLogger ¶
func SetLogLevel ¶
func WriteToLog ¶
Types ¶
type LogConf ¶
type LogConf struct { LogFile string `mapstructure:"logfile"` LogLevel string `mapstructure:"loglevel"` LogFormat string `mapstructure:"logformat"` }
func (*LogConf) CreateNewLogger ¶
logFile: full path of log file. default, os.Stdout is used logLevel: debug, info, warning, error. default warning is used format: json, text
type MyLog ¶
func (*MyLog) CreateNewRawLogger ¶
func (this *MyLog) CreateNewRawLogger()
func (*MyLog) ExitProgram ¶
func (*MyLog) GenLogFields ¶
func (*MyLog) SetLogConf ¶
func (this *MyLog) SetLogConf()
func (*MyLog) WriteToLogByFields ¶
func (*MyLog) WriteToLogByFieldsError ¶
func (*MyLog) WriteToLogByFieldsErrorExit ¶
func (*MyLog) WriteToLogByFieldsErrorExtramsg ¶
func (*MyLog) WriteToLogByFieldsErrorExtramsgExit ¶
func (*MyLog) WriteToLogByFieldsErrorExtramsgExitCode ¶
func (*MyLog) WriteToLogByFieldsErrorExtramsgStack ¶
func (*MyLog) WriteToLogByFieldsErrorExtramsgStackExit ¶
func (*MyLog) WriteToLogByFieldsErrorNormal ¶
func (*MyLog) WriteToLogByFieldsErrorStack ¶
func (*MyLog) WriteToLogByFieldsErrorStackExit ¶
func (*MyLog) WriteToLogByFieldsExit ¶
func (*MyLog) WriteToLogByFieldsExitMsgNoErr ¶
func (*MyLog) WriteToLogByFieldsExitMsgNoErrStack ¶
func (*MyLog) WriteToLogByFieldsNormal ¶
func (*MyLog) WriteToLogByFieldsNormalOnlyMsg ¶
func (*MyLog) WriteToLogByFieldsNormalOnlyMsgExitCode ¶
func (*MyLog) WriteToLogByFieldsNormalOnlyMsgStack ¶
func (*MyLog) WriteToLogByFieldsStack ¶
func (*MyLog) WriteToLogByFieldsStackExit ¶
func (*MyLog) WriteToLogByMsg ¶
func (*MyLog) WriteToLogByMsgExit ¶
func (*MyLog) WriteToLogByMsgNormal ¶
func (*MyLog) WriteToLogByMsgStack ¶
Click to show internal directories.
Click to hide internal directories.