Documentation ¶
Index ¶
- Constants
- func Debug(format string, v ...interface{})
- func DebugContext(ctx context.Context, format string, v ...interface{})
- func Err(format string, v ...interface{})
- func ErrContext(ctx context.Context, format string, v ...interface{})
- func ErrNoStack(format string, v ...interface{})
- func ErrNoStackContext(ctx context.Context, format string, v ...interface{})
- func Fatal(format string, v ...interface{})
- func FatalContext(ctx context.Context, format string, v ...interface{})
- func Info(format string, v ...interface{})
- func InfoContext(ctx context.Context, format string, v ...interface{})
- func Panic(format string, v ...interface{})
- func PanicContext(ctx context.Context, format string, v ...interface{})
- func SetupLogger(ptHost string, ptPort string)
- func SetupLoggerAuto(appName string, ptEndpoint string)
- func Trace(format string, v ...interface{})
- func TraceContext(ctx context.Context, format string, v ...interface{})
- func Warn(format string, v ...interface{})
- func WarnContext(ctx context.Context, format string, v ...interface{})
Constants ¶
View Source
const ( // LogLevelTrace outputs TRACE, DEBUG, INFO, WARNING, ERROR, and PANIC logs LogLevelTrace = "TRACE" // LogLevelDebug outputs DEBUG, INFO, WARNING, ERROR, and PANIC logs LogLevelDebug = "DEBUG" // LogLevelInfo outputs INFO, WARNING, ERROR, and PANIC logs LogLevelInfo = "INFO" // LogLevelWarning outputs WARNING, ERROR, and PANIC logs LogLevelWarning = "WARNING" // LogLevelError outputs ERROR and PANIC logs LogLevelError = "ERROR" // LogLevelPanic outputs PANIC logs only LogLevelPanic = "PANIC" )
Variables ¶
This section is empty.
Functions ¶
func DebugContext ¶
DebugContext prints debug message to logs
func ErrContext ¶
ErrContext prints error message to logs
func ErrNoStack ¶
func ErrNoStack(format string, v ...interface{})
ErrNoStack prints error message to logs without stacktrace
func ErrNoStackContext ¶
ErrNoStackContext prints error message to logs without stacktrace
func FatalContext ¶
FatalContext calls Err and then os.Exit(1)
func InfoContext ¶
InfoContext prints info message to logs
func PanicContext ¶
PanicContext prints panic message to logs
func SetupLogger ¶
SetupLogger creates logger instance to log to PaperTrail and Console. Should only called once in main function.
func SetupLoggerAuto ¶
SetupLoggerAuto creates logger instance to log to PaperTrail automatically without specifying PT HOST and PORT
func TraceContext ¶
TraceContext prints trace message to logs
func WarnContext ¶
WarnContext prints warning message to logs
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.