Documentation ¶
Index ¶
- Constants
- func Debug(v ...any)
- func DebugH(v ...any)
- func DebugME(v ...any)
- func DebugMS(v ...any)
- func DebugOpts(opts Options, v ...any)
- func DebugOptsH(opts Options, v ...any)
- func DebugOptsME(opts Options, v ...any)
- func DebugOptsMS(opts Options, v ...any)
- func DebugOptsf(format string, opts Options, v ...any)
- func DebugOptsfH(format string, opts Options, v ...any)
- func DebugOptsfME(format string, opts Options, v ...any)
- func DebugOptsfMS(format string, opts Options, v ...any)
- func DebugSkipCaller(skipCaller int, v ...any)
- func DebugSkipCallerH(skipCaller int, v ...any)
- func DebugSkipCallerME(skipCaller int, v ...any)
- func DebugSkipCallerMS(skipCaller int, v ...any)
- func DebugSkipCallerOpts(skipCaller int, opts Options, v ...any)
- func DebugSkipCallerOptsH(skipCaller int, opts Options, v ...any)
- func DebugSkipCallerOptsME(skipCaller int, opts Options, v ...any)
- func DebugSkipCallerOptsMS(skipCaller int, opts Options, v ...any)
- func DebugSkipCallerOptsf(format string, skipCaller int, opts Options, v ...any)
- func DebugSkipCallerOptsfH(format string, skipCaller int, opts Options, v ...any)
- func DebugSkipCallerOptsfME(format string, skipCaller int, opts Options, v ...any)
- func DebugSkipCallerOptsfMS(format string, skipCaller int, opts Options, v ...any)
- func DebugSkipCallerf(format string, skipCaller int, v ...any)
- func DebugSkipCallerfH(format string, skipCaller int, v ...any)
- func DebugSkipCallerfME(format string, skipCaller int, v ...any)
- func DebugSkipCallerfMS(format string, skipCaller int, v ...any)
- func Debugf(format string, v ...any)
- func DebugfH(format string, v ...any)
- func DebugfME(format string, v ...any)
- func DebugfMS(format string, v ...any)
- func Error(v ...any)
- func ErrorH(v ...any)
- func ErrorME(v ...any)
- func ErrorMS(v ...any)
- func ErrorOpts(opts Options, v ...any)
- func ErrorOptsH(opts Options, v ...any)
- func ErrorOptsME(opts Options, v ...any)
- func ErrorOptsMS(opts Options, v ...any)
- func ErrorOptsf(format string, opts Options, v ...any)
- func ErrorOptsfH(format string, opts Options, v ...any)
- func ErrorOptsfME(format string, opts Options, v ...any)
- func ErrorOptsfMS(format string, opts Options, v ...any)
- func ErrorSkipCaller(skipCaller int, v ...any)
- func ErrorSkipCallerH(skipCaller int, v ...any)
- func ErrorSkipCallerME(skipCaller int, v ...any)
- func ErrorSkipCallerMS(skipCaller int, v ...any)
- func ErrorSkipCallerOpts(skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerOptsH(skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerOptsME(skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerOptsMS(skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerOptsf(format string, skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerOptsfH(format string, skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerOptsfME(format string, skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerOptsfMS(format string, skipCaller int, opts Options, v ...any)
- func ErrorSkipCallerf(format string, skipCaller int, v ...any)
- func ErrorSkipCallerfH(format string, skipCaller int, v ...any)
- func ErrorSkipCallerfME(format string, skipCaller int, v ...any)
- func ErrorSkipCallerfMS(format string, skipCaller int, v ...any)
- func Errorf(format string, v ...any)
- func ErrorfH(format string, v ...any)
- func ErrorfME(format string, v ...any)
- func ErrorfMS(format string, v ...any)
- func Info(v ...any)
- func InfoH(v ...any)
- func InfoME(v ...any)
- func InfoMS(v ...any)
- func InfoOpts(opts Options, v ...any)
- func InfoOptsH(opts Options, v ...any)
- func InfoOptsME(opts Options, v ...any)
- func InfoOptsMS(opts Options, v ...any)
- func InfoOptsf(format string, opts Options, v ...any)
- func InfoOptsfH(format string, opts Options, v ...any)
- func InfoOptsfME(format string, opts Options, v ...any)
- func InfoOptsfMS(format string, opts Options, v ...any)
- func InfoSkipCaller(skipCaller int, v ...any)
- func InfoSkipCallerH(skipCaller int, v ...any)
- func InfoSkipCallerME(skipCaller int, v ...any)
- func InfoSkipCallerMS(skipCaller int, v ...any)
- func InfoSkipCallerOpts(skipCaller int, opts Options, v ...any)
- func InfoSkipCallerOptsH(skipCaller int, opts Options, v ...any)
- func InfoSkipCallerOptsME(skipCaller int, opts Options, v ...any)
- func InfoSkipCallerOptsMS(skipCaller int, opts Options, v ...any)
- func InfoSkipCallerOptsf(format string, skipCaller int, opts Options, v ...any)
- func InfoSkipCallerOptsfH(format string, skipCaller int, opts Options, v ...any)
- func InfoSkipCallerOptsfME(format string, skipCaller int, opts Options, v ...any)
- func InfoSkipCallerOptsfMS(format string, skipCaller int, opts Options, v ...any)
- func InfoSkipCallerf(format string, skipCaller int, v ...any)
- func InfoSkipCallerfH(format string, skipCaller int, v ...any)
- func InfoSkipCallerfME(format string, skipCaller int, v ...any)
- func InfoSkipCallerfMS(format string, skipCaller int, v ...any)
- func Infof(format string, v ...any)
- func InfofH(format string, v ...any)
- func InfofME(format string, v ...any)
- func InfofMS(format string, v ...any)
- func RandomCustomPrefix() string
- func RandomLevel() level
- func RandomOut() io.Writer
- func ResetOptionsToDefault()
- func SetOptions(options *Options)
- func Warn(v ...any)
- func WarnH(v ...any)
- func WarnME(v ...any)
- func WarnMS(v ...any)
- func WarnOpts(opts Options, v ...any)
- func WarnOptsH(opts Options, v ...any)
- func WarnOptsME(opts Options, v ...any)
- func WarnOptsMS(opts Options, v ...any)
- func WarnOptsf(format string, opts Options, v ...any)
- func WarnOptsfH(format string, opts Options, v ...any)
- func WarnOptsfME(format string, opts Options, v ...any)
- func WarnOptsfMS(format string, opts Options, v ...any)
- func WarnSkipCaller(skipCaller int, v ...any)
- func WarnSkipCallerH(skipCaller int, v ...any)
- func WarnSkipCallerME(skipCaller int, v ...any)
- func WarnSkipCallerMS(skipCaller int, v ...any)
- func WarnSkipCallerOpts(skipCaller int, opts Options, v ...any)
- func WarnSkipCallerOptsH(skipCaller int, opts Options, v ...any)
- func WarnSkipCallerOptsME(skipCaller int, opts Options, v ...any)
- func WarnSkipCallerOptsMS(skipCaller int, opts Options, v ...any)
- func WarnSkipCallerOptsf(format string, skipCaller int, opts Options, v ...any)
- func WarnSkipCallerOptsfH(format string, skipCaller int, opts Options, v ...any)
- func WarnSkipCallerOptsfME(format string, skipCaller int, opts Options, v ...any)
- func WarnSkipCallerOptsfMS(format string, skipCaller int, opts Options, v ...any)
- func WarnSkipCallerf(format string, skipCaller int, v ...any)
- func WarnSkipCallerfH(format string, skipCaller int, v ...any)
- func WarnSkipCallerfME(format string, skipCaller int, v ...any)
- func WarnSkipCallerfMS(format string, skipCaller int, v ...any)
- func Warnf(format string, v ...any)
- func WarnfH(format string, v ...any)
- func WarnfME(format string, v ...any)
- func WarnfMS(format string, v ...any)
- type BaseEnum
- type DateFormat
- type Mode
- type Options
Constants ¶
const ( StyleReset = "\x1b[0m" StyleBold = "\x1b[1m" StyleDim = "\x1b[2m" StyleUnderscore = "\x1b[4m" StyleBlink = "\x1b[5m" StyleReverse = "\x1b[7m" StyleHidden = "\x1b[8m" ForegroundBlack = "\x1b[30m" ForegroundRed = "\x1b[31m" ForegroundGreen = "\x1b[32m" ForegroundYellow = "\x1b[33m" ForegroundBlue = "\x1b[34m" ForegroundMagenta = "\x1b[35m" ForegroundCyan = "\x1b[36m" ForegroundWhite = "\x1b[37m" BackgroundBlack = "\x1b[40m" BackgroundRed = "\x1b[41m" BackgroundGreen = "\x1b[42m" BackgroundYellow = "\x1b[43m" BackgroundBlue = "\x1b[44m" BackgroundMagenta = "\x1b[45m" BackgroundCyan = "\x1b[46m" BackgroundWhite = "\x1b[47m" )
const ( InfoLevel level = "INFO" DebugLevel level = "DEBUG" WarnLevel level = "WARN" ErrorLevel level = "ERROR" )
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(v ...any)
Debug is a function that records informational messages based on the global Options variable, using the level DEBUG.
Usage Example: ¶
logger.Debug("test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func DebugH ¶
func DebugH(v ...any)
DebugH is a function that records informational messages based on the Options global variable, using the DEBUG level. Unlike Debug, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugH("test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: **** **** *** *****
func DebugME ¶
func DebugME(v ...any)
DebugME is a function that records informational messages based on the Options global variable, using the DEBUG level. Unlike Debug, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugME("test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func DebugMS ¶
func DebugMS(v ...any)
DebugMS is a function that records informational messages based on the Options global variable, using the DEBUG level. Unlike Debug, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugMS("test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func DebugOpts ¶
DebugOpts is a function that records informational messages, using the DEBUG level. Unlike Debug, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.DebugOpts(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func DebugOptsH ¶
DebugOptsH is a function that records informative messages based on the Options variable passed as a parameter, using the DEBUG level. Unlike DebugOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugOptsH(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: ****, ****, ***, *****
func DebugOptsME ¶
DebugOptsME is a function that records informative messages based on the Options variable passed as a parameter, using the DEBUG level. Unlike DebugOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugOptsME(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func DebugOptsMS ¶
DebugOptsMS is a function that records informative messages based on the Options variable passed as a parameter, using the DEBUG level. Unlike DebugOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugOptsMS(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func DebugOptsf ¶
DebugOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level. Unlike DebugOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.DebugOptsf("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func DebugOptsfH ¶
DebugOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level, print the parameters v also based on the format entered as a parameter. Unlike DebugOptsf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugOptsfH("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func DebugOptsfME ¶
DebugOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level, print the parameters v also based on the format entered as a parameter. Unlike DebugOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugOptsfME("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func DebugOptsfMS ¶
DebugOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level, print the parameters v also based on the format entered as a parameter. Unlike DebugOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugOptsfMS("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
func DebugSkipCaller ¶
DebugSkipCaller is a function that logs informational messages based on the Options global variable, using the DEBUG level. Unlike Debug, this function passes skipCaller as a parameter, therefore the value passed directly impacts the file name and line when printing the message.
Usage Example: ¶
logger.DebugSkipCaller(2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:139: te** tr** 1** 10***
func DebugSkipCallerH ¶
DebugSkipCallerH is a function that logs informational messages based on the Options global variable, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCaller, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerH(2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: ****, ****, ***, *****
func DebugSkipCallerME ¶
DebugSkipCallerME is a function that logs informational messages based on the Options global variable, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCaller, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerME(2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func DebugSkipCallerMS ¶
DebugSkipCallerMS is a function that logs informational messages based on the Options global variable, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCaller, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerMS(2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func DebugSkipCallerOpts ¶
DebugSkipCallerOpts is a function that records informational messages, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCaller, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.DebugSkipCallerOpts(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func DebugSkipCallerOptsH ¶
DebugSkipCallerOptsH is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCallerOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerOptsH(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:23: **** **** *** *****
func DebugSkipCallerOptsME ¶
DebugSkipCallerOptsME is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCallerOpts, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerOptsME(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: te** tr** 1** 10***
func DebugSkipCallerOptsMS ¶
DebugSkipCallerOptsMS is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCallerOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerOptsMS(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func DebugSkipCallerOptsf ¶
DebugSkipCallerOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCallerOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.DebugSkipCallerOptsf("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func DebugSkipCallerOptsfH ¶
DebugSkipCallerOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike DebugSkipCallerOptsf, this function will mask the last half of all values passed as v settings when printing a message.
Usage Example: ¶
logger.DebugSkipCallerOptsfH("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func DebugSkipCallerOptsfME ¶
DebugSkipCallerOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike DebugSkipCallerOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerOptsfME("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func DebugSkipCallerOptsfMS ¶
DebugSkipCallerOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the DEBUG level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike DebugSkipCallerOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerOptsfMS("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func DebugSkipCallerf ¶
DebugSkipCallerf is a function that logs informational messages based on the Options global variable, using the DEBUG level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike DebugSkipCaller, this function passes the format you want as a parameter, so the value passed will have an impact on the format of the printed message.
Usage Example: ¶
logger.DebugSkipCallerf("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func DebugSkipCallerfH ¶
DebugSkipCallerfH is a function that writes informational messages based on the Options global variable, using the DEBUG level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike DebugSkipCallerf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerfH("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func DebugSkipCallerfME ¶
DebugSkipCallerfME is a function that writes informational messages based on the Options global variable, using the DEBUG level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike DebugSkipCallerf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerfME("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func DebugSkipCallerfMS ¶
DebugSkipCallerfMS is a function that writes informational messages based on the Options global variable, using the DEBUG level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike DebugSkipCallerf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugSkipCallerfMS("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func Debugf ¶
Debugf is a function that records informational messages based on the Options global variable, using the DEBUG level. Unlike Debug, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.Debugf("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func DebugfH ¶
DebugfH is a function that records informational messages based on the Options global variable, using the DEBUG level, printing the parameters v based on the format entered as a parameter. Unlike Debugf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugfH("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func DebugfME ¶
DebugfME is a function that records informational messages based on the Options global variable, using the DEBUG level, printing the parameters v based on the format entered as a parameter. Unlike Debugf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugfME("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func DebugfMS ¶
DebugfMS is a function that records informational messages based on the Options global variable, using the DEBUG level, printing the parameters v based on the format entered as a parameter. Unlike Debugf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.DebugfMS("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[DEBUG 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
func Error ¶
func Error(v ...any)
Error is a function that records informational messages based on the global Options variable, using the level ERROR.
Usage Example: ¶
logger.Error("test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func ErrorH ¶
func ErrorH(v ...any)
ErrorH is a function that records informational messages based on the Options global variable, using the ERROR level. Unlike Error, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorH("test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: **** **** *** *****
func ErrorME ¶
func ErrorME(v ...any)
ErrorME is a function that records informational messages based on the Options global variable, using the ERROR level. Unlike Error, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorME("test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func ErrorMS ¶
func ErrorMS(v ...any)
ErrorMS is a function that records informational messages based on the Options global variable, using the ERROR level. Unlike Error, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorMS("test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func ErrorOpts ¶
ErrorOpts is a function that records informational messages, using the ERROR level. Unlike Error, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.ErrorOpts(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func ErrorOptsH ¶
ErrorOptsH is a function that records informative messages based on the Options variable passed as a parameter, using the ERROR level. Unlike ErrorOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorOptsH(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: ****, ****, ***, *****
func ErrorOptsME ¶
ErrorOptsME is a function that records informative messages based on the Options variable passed as a parameter, using the ERROR level. Unlike ErrorOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorOptsME(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func ErrorOptsMS ¶
ErrorOptsMS is a function that records informative messages based on the Options variable passed as a parameter, using the ERROR level. Unlike ErrorOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorOptsMS(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func ErrorOptsf ¶
ErrorOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level. Unlike ErrorOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.ErrorOptsf("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func ErrorOptsfH ¶
ErrorOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level, print the parameters v also based on the format entered as a parameter. Unlike ErrorOptsf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorOptsfH("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func ErrorOptsfME ¶
ErrorOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level, print the parameters v also based on the format entered as a parameter. Unlike ErrorOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorOptsfME("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func ErrorOptsfMS ¶
ErrorOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level, print the parameters v also based on the format entered as a parameter. Unlike ErrorOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorOptsfMS("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
func ErrorSkipCaller ¶
ErrorSkipCaller is a function that logs informational messages based on the Options global variable, using the ERROR level. Unlike Error, this function passes skipCaller as a parameter, therefore the value passed directly impacts the file name and line when printing the message.
Usage Example: ¶
logger.ErrorSkipCaller(2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:139: te** tr** 1** 10***
func ErrorSkipCallerH ¶
ErrorSkipCallerH is a function that logs informational messages based on the Options global variable, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCaller, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerH(2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: ****, ****, ***, *****
func ErrorSkipCallerME ¶
ErrorSkipCallerME is a function that logs informational messages based on the Options global variable, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCaller, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerME(2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func ErrorSkipCallerMS ¶
ErrorSkipCallerMS is a function that logs informational messages based on the Options global variable, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCaller, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerMS(2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func ErrorSkipCallerOpts ¶
ErrorSkipCallerOpts is a function that records informational messages, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCaller, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.ErrorSkipCallerOpts(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func ErrorSkipCallerOptsH ¶
ErrorSkipCallerOptsH is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCallerOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerOptsH(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:23: **** **** *** *****
func ErrorSkipCallerOptsME ¶
ErrorSkipCallerOptsME is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCallerOpts, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerOptsME(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: te** tr** 1** 10***
func ErrorSkipCallerOptsMS ¶
ErrorSkipCallerOptsMS is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCallerOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerOptsMS(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func ErrorSkipCallerOptsf ¶
ErrorSkipCallerOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCallerOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.ErrorSkipCallerOptsf("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func ErrorSkipCallerOptsfH ¶
ErrorSkipCallerOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike ErrorSkipCallerOptsf, this function will mask the last half of all values passed as v settings when printing a message.
Usage Example: ¶
logger.ErrorSkipCallerOptsfH("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func ErrorSkipCallerOptsfME ¶
ErrorSkipCallerOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike ErrorSkipCallerOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerOptsfME("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func ErrorSkipCallerOptsfMS ¶
ErrorSkipCallerOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the ERROR level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike ErrorSkipCallerOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerOptsfMS("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func ErrorSkipCallerf ¶
ErrorSkipCallerf is a function that logs informational messages based on the Options global variable, using the ERROR level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike ErrorSkipCaller, this function passes the format you want as a parameter, so the value passed will have an impact on the format of the printed message.
Usage Example: ¶
logger.ErrorSkipCallerf("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func ErrorSkipCallerfH ¶
ErrorSkipCallerfH is a function that writes informational messages based on the Options global variable, using the ERROR level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike ErrorSkipCallerf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerfH("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func ErrorSkipCallerfME ¶
ErrorSkipCallerfME is a function that writes informational messages based on the Options global variable, using the ERROR level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike ErrorSkipCallerf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerfME("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func ErrorSkipCallerfMS ¶
ErrorSkipCallerfMS is a function that writes informational messages based on the Options global variable, using the ERROR level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike ErrorSkipCallerf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorSkipCallerfMS("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func Errorf ¶
Errorf is a function that records informational messages based on the Options global variable, using the ERROR level. Unlike Error, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.Errorf("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func ErrorfH ¶
ErrorfH is a function that records informational messages based on the Options global variable, using the ERROR level, printing the parameters v based on the format entered as a parameter. Unlike Errorf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorfH("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func ErrorfME ¶
ErrorfME is a function that records informational messages based on the Options global variable, using the ERROR level, printing the parameters v based on the format entered as a parameter. Unlike Errorf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorfME("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func ErrorfMS ¶
ErrorfMS is a function that records informational messages based on the Options global variable, using the ERROR level, printing the parameters v based on the format entered as a parameter. Unlike Errorf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.ErrorfMS("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[ERROR 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
func Info ¶
func Info(v ...any)
Info is a function that records informational messages based on the global Options variable, using the level INFO.
Usage Example: ¶
logger.Info("test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func InfoH ¶
func InfoH(v ...any)
InfoH is a function that records informational messages based on the Options global variable, using the INFO level. Unlike Info, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoH("test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: **** **** *** *****
func InfoME ¶
func InfoME(v ...any)
InfoME is a function that records informational messages based on the Options global variable, using the INFO level. Unlike Info, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoME("test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func InfoMS ¶
func InfoMS(v ...any)
InfoMS is a function that records informational messages based on the Options global variable, using the INFO level. Unlike Info, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoMS("test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func InfoOpts ¶
InfoOpts is a function that records informational messages, using the INFO level. Unlike Info, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.InfoOpts(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func InfoOptsH ¶
InfoOptsH is a function that records informative messages based on the Options variable passed as a parameter, using the INFO level. Unlike InfoOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoOptsH(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: ****, ****, ***, *****
func InfoOptsME ¶
InfoOptsME is a function that records informative messages based on the Options variable passed as a parameter, using the INFO level. Unlike InfoOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoOptsME(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func InfoOptsMS ¶
InfoOptsMS is a function that records informative messages based on the Options variable passed as a parameter, using the INFO level. Unlike InfoOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoOptsMS(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func InfoOptsf ¶
InfoOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level. Unlike InfoOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.InfoOptsf("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func InfoOptsfH ¶
InfoOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level, print the parameters v also based on the format entered as a parameter. Unlike InfoOptsf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoOptsfH("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func InfoOptsfME ¶
InfoOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level, print the parameters v also based on the format entered as a parameter. Unlike InfoOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoOptsfME("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func InfoOptsfMS ¶
InfoOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level, print the parameters v also based on the format entered as a parameter. Unlike InfoOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoOptsfMS("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
func InfoSkipCaller ¶
InfoSkipCaller is a function that logs informational messages based on the Options global variable, using the INFO level. Unlike Info, this function passes skipCaller as a parameter, therefore the value passed directly impacts the file name and line when printing the message.
Usage Example: ¶
logger.InfoSkipCaller(2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:139: te** tr** 1** 10***
func InfoSkipCallerH ¶
InfoSkipCallerH is a function that logs informational messages based on the Options global variable, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCaller, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerH(2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: ****, ****, ***, *****
func InfoSkipCallerME ¶
InfoSkipCallerME is a function that logs informational messages based on the Options global variable, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCaller, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerME(2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func InfoSkipCallerMS ¶
InfoSkipCallerMS is a function that logs informational messages based on the Options global variable, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCaller, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerMS(2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func InfoSkipCallerOpts ¶
InfoSkipCallerOpts is a function that records informational messages, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCaller, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.InfoSkipCallerOpts(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func InfoSkipCallerOptsH ¶
InfoSkipCallerOptsH is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCallerOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerOptsH(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:23: **** **** *** *****
func InfoSkipCallerOptsME ¶
InfoSkipCallerOptsME is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCallerOpts, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerOptsME(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: te** tr** 1** 10***
func InfoSkipCallerOptsMS ¶
InfoSkipCallerOptsMS is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCallerOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerOptsMS(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func InfoSkipCallerOptsf ¶
InfoSkipCallerOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCallerOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.InfoSkipCallerOptsf("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func InfoSkipCallerOptsfH ¶
InfoSkipCallerOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike InfoSkipCallerOptsf, this function will mask the last half of all values passed as v settings when printing a message.
Usage Example: ¶
logger.InfoSkipCallerOptsfH("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func InfoSkipCallerOptsfME ¶
InfoSkipCallerOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike InfoSkipCallerOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerOptsfME("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func InfoSkipCallerOptsfMS ¶
InfoSkipCallerOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the INFO level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike InfoSkipCallerOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerOptsfMS("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func InfoSkipCallerf ¶
InfoSkipCallerf is a function that logs informational messages based on the Options global variable, using the INFO level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike InfoSkipCaller, this function passes the format you want as a parameter, so the value passed will have an impact on the format of the printed message.
Usage Example: ¶
logger.InfoSkipCallerf("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func InfoSkipCallerfH ¶
InfoSkipCallerfH is a function that writes informational messages based on the Options global variable, using the INFO level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike InfoSkipCallerf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerfH("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func InfoSkipCallerfME ¶
InfoSkipCallerfME is a function that writes informational messages based on the Options global variable, using the INFO level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike InfoSkipCallerf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerfME("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func InfoSkipCallerfMS ¶
InfoSkipCallerfMS is a function that writes informational messages based on the Options global variable, using the INFO level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike InfoSkipCallerf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfoSkipCallerfMS("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func Infof ¶
Infof is a function that records informational messages based on the Options global variable, using the INFO level. Unlike Info, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.Infof("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func InfofH ¶
InfofH is a function that records informational messages based on the Options global variable, using the INFO level, printing the parameters v based on the format entered as a parameter. Unlike Infof, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfofH("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func InfofME ¶
InfofME is a function that records informational messages based on the Options global variable, using the INFO level, printing the parameters v based on the format entered as a parameter. Unlike Infof, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfofME("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func InfofMS ¶
InfofMS is a function that records informational messages based on the Options global variable, using the INFO level, printing the parameters v based on the format entered as a parameter. Unlike Infof, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.InfofMS("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[INFO 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
func RandomCustomPrefix ¶ added in v1.1.2
func RandomCustomPrefix() string
func RandomLevel ¶ added in v1.3.1
func RandomLevel() level
func ResetOptionsToDefault ¶
func ResetOptionsToDefault()
ResetOptionsToDefault resets the global options to their default values. This function initializes the opts variable with a new instance of the Options struct, effectively resetting all options to their default values.
Example usage: ¶
logger.ResetOptionsToDefault()
Return: ¶
None
func SetOptions ¶
func SetOptions(options *Options)
SetOptions sets the global options to the specified options pointer.
This function allows you to configure the behavior of the logging package by setting various options such as print mode, date format, asynchronous mode, etc.
Example usage: ¶
logger.SetOptions(logger.Options{})
Parameters: ¶
options - A pointer to an Options struct that contains the desired configuration options.
Note: ¶
The Options struct contains the following fields: - Mode: Print mode (default: ModeDefault) - DateFormat: Argument date format (default: DateFormatFull24h) - EnableAsynchronousMode: Enable asynchronous printing mode (default: false) - UTC: Enable argument date to be UTC (default: false) - DontPrintEmptyMessage: Enable to not print empty message (default: false) - RemoveSpace: Enable to remove spaces between parameters (default: false) - HideAllArgs: If true will hide all datetime and prefix arguments (default: false) - HideArgDatetime: If true it will hide the datetime arguments (default: false) - HideArgCaller: If true, it will hide the caller arguments (default: false) - DisablePrefixColors: If true, it will disable all argument and prefix colors (default: false) - EnableJsonMsgFieldForSlice: If true, json mode msg field becomes slice (default: false, only if Mode is ModeJson) IMPORTANT: If true, the format parameter will not work
Return: ¶
None
func Warn ¶ added in v1.3.1
func Warn(v ...any)
Warn is a function that records informational messages based on the global Options variable, using the level WARN.
Usage Example: ¶
logger.Warn("test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func WarnH ¶ added in v1.3.1
func WarnH(v ...any)
WarnH is a function that records informational messages based on the Options global variable, using the WARN level. Unlike Warn, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnH("test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: **** **** *** *****
func WarnME ¶ added in v1.3.1
func WarnME(v ...any)
WarnME is a function that records informational messages based on the Options global variable, using the WARN level. Unlike Warn, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnME("test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func WarnMS ¶ added in v1.3.1
func WarnMS(v ...any)
WarnMS is a function that records informational messages based on the Options global variable, using the WARN level. Unlike Warn, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnMS("test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func WarnOpts ¶ added in v1.3.1
WarnOpts is a function that records informational messages, using the WARN level. Unlike Warn, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.WarnOpts(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: test true 112 10.99
func WarnOptsH ¶ added in v1.3.1
WarnOptsH is a function that records informative messages based on the Options variable passed as a parameter, using the WARN level. Unlike WarnOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnOptsH(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: ****, ****, ***, *****
func WarnOptsME ¶ added in v1.3.1
WarnOptsME is a function that records informative messages based on the Options variable passed as a parameter, using the WARN level. Unlike WarnOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnOptsME(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func WarnOptsMS ¶ added in v1.3.1
WarnOptsMS is a function that records informative messages based on the Options variable passed as a parameter, using the WARN level. Unlike WarnOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnOptsMS(Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: **st **ue **2 ***99
func WarnOptsf ¶ added in v1.3.1
WarnOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level. Unlike WarnOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.WarnOptsf("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func WarnOptsfH ¶ added in v1.3.1
WarnOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level, print the parameters v also based on the format entered as a parameter. Unlike WarnOptsf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnOptsfH("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func WarnOptsfME ¶ added in v1.3.1
WarnOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level, print the parameters v also based on the format entered as a parameter. Unlike WarnOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnOptsfME("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func WarnOptsfMS ¶ added in v1.3.1
WarnOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level, print the parameters v also based on the format entered as a parameter. Unlike WarnOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnOptsfMS("%s, %s, %s, last is %s", Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
func WarnSkipCaller ¶ added in v1.3.1
WarnSkipCaller is a function that logs informational messages based on the Options global variable, using the WARN level. Unlike Warn, this function passes skipCaller as a parameter, therefore the value passed directly impacts the file name and line when printing the message.
Usage Example: ¶
logger.WarnSkipCaller(2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:139: te** tr** 1** 10***
func WarnSkipCallerH ¶ added in v1.3.1
WarnSkipCallerH is a function that logs informational messages based on the Options global variable, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCaller, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerH(2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: ****, ****, ***, *****
func WarnSkipCallerME ¶ added in v1.3.1
WarnSkipCallerME is a function that logs informational messages based on the Options global variable, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCaller, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerME(2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: te** tr** 1** 10***
func WarnSkipCallerMS ¶ added in v1.3.1
WarnSkipCallerMS is a function that logs informational messages based on the Options global variable, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCaller, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerMS(2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func WarnSkipCallerOpts ¶ added in v1.3.1
WarnSkipCallerOpts is a function that records informational messages, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCaller, this function passes Options as a parameter, and it will only be persisted in that message, therefore, this Options passed as a parameter will not impact other flows using global Options.
Usage Example: ¶
logger.WarnSkipCallerOpts(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func WarnSkipCallerOptsH ¶ added in v1.3.1
WarnSkipCallerOptsH is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCallerOpts, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerOptsH(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:23: **** **** *** *****
func WarnSkipCallerOptsME ¶ added in v1.3.1
WarnSkipCallerOptsME is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCallerOpts, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerOptsME(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: te** tr** 1** 10***
func WarnSkipCallerOptsMS ¶ added in v1.3.1
WarnSkipCallerOptsMS is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCallerOpts, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerOptsMS(2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: **st **ue **2 ***99
func WarnSkipCallerOptsf ¶ added in v1.3.1
WarnSkipCallerOptsf is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCallerOpts, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.WarnSkipCallerOptsf("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func WarnSkipCallerOptsfH ¶ added in v1.3.1
WarnSkipCallerOptsfH is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike WarnSkipCallerOptsf, this function will mask the last half of all values passed as v settings when printing a message.
Usage Example: ¶
logger.WarnSkipCallerOptsfH("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func WarnSkipCallerOptsfME ¶ added in v1.3.1
WarnSkipCallerOptsfME is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike WarnSkipCallerOptsf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerOptsfME("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func WarnSkipCallerOptsfMS ¶ added in v1.3.1
WarnSkipCallerOptsfMS is a function that records informational messages based on the Options variable passed as a parameter, using the WARN level. The file name and line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike WarnSkipCallerOptsf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerOptsfMS("%s, %s, %s, last is %s", 2, Options{}, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func WarnSkipCallerf ¶ added in v1.3.1
WarnSkipCallerf is a function that logs informational messages based on the Options global variable, using the WARN level, the file name and line information in the message will be based on the value of the skipCaller parameter. Unlike WarnSkipCaller, this function passes the format you want as a parameter, so the value passed will have an impact on the format of the printed message.
Usage Example: ¶
logger.WarnSkipCallerf("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: test, true, 112, last is 10.99
func WarnSkipCallerfH ¶ added in v1.3.1
WarnSkipCallerfH is a function that writes informational messages based on the Options global variable, using the WARN level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike WarnSkipCallerf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerfH("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:23: ****, ****, ***, last is *****
func WarnSkipCallerfME ¶ added in v1.3.1
WarnSkipCallerfME is a function that writes informational messages based on the Options global variable, using the WARN level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike WarnSkipCallerf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerfME("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: te**, tr**, 1**, last is 10***
func WarnSkipCallerfMS ¶ added in v1.3.1
WarnSkipCallerfMS is a function that writes informational messages based on the Options global variable, using the WARN level. The file name and the line information in the message will be based on the value of the skipCaller parameter, this function also prints the v parameters based on the format passed in the format parameter. Unlike WarnSkipCallerf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnSkipCallerfMS("%s, %s, %s, last is %s", 2, "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] subexample.go:239: **st, **ue, **2, last is ***99
func Warnf ¶ added in v1.3.1
Warnf is a function that records informational messages based on the Options global variable, using the WARN level. Unlike Warn, this function passes the format you want as a parameter, so the value passed will impact the format of the printed message.
Usage Example: ¶
logger.Warnf("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: test, true, 112, last is 10.99
func WarnfH ¶ added in v1.3.1
WarnfH is a function that records informational messages based on the Options global variable, using the WARN level, printing the parameters v based on the format entered as a parameter. Unlike Warnf, this function will hide all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnfH("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: ****, ****, ***, last is *****
func WarnfME ¶ added in v1.3.1
WarnfME is a function that records informational messages based on the Options global variable, using the WARN level, printing the parameters v based on the format entered as a parameter. Unlike Warnf, this function will mask the last half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnfME("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: te**, tr**, 1**, last is 10***
func WarnfMS ¶ added in v1.3.1
WarnfMS is a function that records informational messages based on the Options global variable, using the WARN level, printing the parameters v based on the format entered as a parameter. Unlike Warnf, this function will mask the first half of all values passed as parameters v when printing the message.
Usage Example: ¶
logger.WarnfMS("%s, %s, %s, last is %s", "test", true, 112, 10.99)
Result (default): ¶
[WARN 2023/12/09 19:26:09] example.go:239: **st, **ue, **2, last is ***99
Types ¶
type DateFormat ¶
type DateFormat string
const ( DateFormatFull24h DateFormat = "2006/01/02 15:04:05" DateFormatFull12h DateFormat = "2006/01/02 3:04:05PM" DateFormatNormal DateFormat = "2006/01/02" DateFormatTime24h DateFormat = "15:04:05" DateFormatTime12h DateFormat = "3:04:05PM" DateFormatTextDate DateFormat = "January 2, 2006" DateFormatTextDatetime24h DateFormat = "January 2, 2006 15:04:05" DateFormatTextDatetime12h DateFormat = "January 2, 2006 3:04:05PM" DateFormatTextDateWithWeekday DateFormat = "Monday, January 2, 2006" DateFormatTextDatetime24hWithWeekday DateFormat = "Monday, January 2, 2006 15:04:05" DateFormatTextDatetime12hWithWeekday DateFormat = "Monday, January 2, 2006 3:04:05PM" DateFormatAbbrTextDate DateFormat = "Jan 2 Mon" DateFormatAbbrTextDatetime24h DateFormat = "Jan 2 Mon 15:04:05" DateFormatAbbrTextDatetime12h DateFormat = "Jan 2 Mon 3:04:05PM" )
func RandomDateFormat ¶
func RandomDateFormat() DateFormat
func (DateFormat) Format ¶
func (d DateFormat) Format() string
type Options ¶
type Options struct { // Out represents an io.Writer that is used for the logging output. Out io.Writer // Level field represents the logging level. It is of type `level`. Level level // Print mode (default: ModeDefault) Mode Mode // Argument date format (default: DateFormatFull24h) DateFormat DateFormat // Custom prefix text CustomPrefixText string // Custom after prefix text CustomAfterPrefixText string // Enable asynchronous printing mode (default: false) EnableAsynchronousMode bool // Enable argument date to be UTC (default: false) UTC bool // Enable to not print empty message (default: false) DontPrintEmptyMessage bool // Enable to remove spaces between parameters (default: false) RemoveSpace bool // If true will hide all datetime and prefix arguments (default: false) HideAllArgs bool // If true it will hide the datetime arguments (default: false) HideArgDatetime bool // If true, it will hide the caller arguments (default: false) HideArgCaller bool // If true, it will disable all argument and prefix colors (default: false) DisablePrefixColors bool // If true, it will disable all message colors (default: false) DisableMessageColors bool // If true, json mode msg field becomes slice (default: false, only if Mode is ModeJson) // // IMPORTANT: If true, the format parameter will not work EnableJsonMsgFieldForSlice bool }
func GetOptions ¶ added in v1.3.4
func GetOptions() Options
GetOptions returns the current global options configuration. This function retrieves the current configuration options for the logging package. The options include print mode, date format, asynchronous mode, etc. Return:
Options - The current global options configuration.