Documentation ¶
Index ¶
- Constants
- func Info(format string, a ...interface{})
- func LogLevel() int32
- type ApplicationLog
- type Logger
- func (l *Logger) Completed(functionName string)
- func (l *Logger) CompletedError(functionName string, err error)
- func (l *Logger) CompletedErrorf(functionName string, err error, format string, a ...interface{})
- func (l *Logger) Completedf(functionName string, format string, a ...interface{})
- func (l *Logger) Debug(format string, a ...interface{})
- func (l *Logger) Error(err string)
- func (l *Logger) ErrorG(format string, a ...interface{})
- func (l *Logger) Errorf(format string, err error, a ...interface{})
- func (l *Logger) GinLogger() gin.HandlerFunc
- func (l *Logger) Info(format string, a ...interface{})
- func (l *Logger) LogDirectoryCleanup(baseFilePath string, daysToKeep int)
- func (l *Logger) Start(logLevel int32)
- func (l *Logger) StartFile(logLevel int32, baseFilePath string, daysToKeep int)
- func (l *Logger) Started(functionName string)
- func (l *Logger) Startedf(functionName string, format string, a ...interface{})
- func (l *Logger) Stop() error
- func (l *Logger) Warning(format string, a ...interface{})
Constants ¶
const ( // LevelDebug logs everything LevelDebug int32 = 1 // LevelInfo logs Info, Warnings and Errors LevelInfo int32 = 2 // LevelWarn logs Warning and Errors LevelWarn int32 = 4 // LevelError logs just Errors LevelError int32 = 8 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplicationLog ¶
type ApplicationLog struct { LogLevel int32 Debug *log.Logger Info *log.Logger Warning *log.Logger Error *log.Logger File *log.Logger LogFile *os.File }
ApplicationLog provides support to write to log files.
type Logger ¶
type Logger struct { // DisableColor default behavior is to log with no color DisableColor bool // DataTimeUTC default behavior is to log at local time DataTimeUTC bool }
Logger it loads the config for logging
func (*Logger) Completed ¶
Completed uses the Serialize destination and writes a Completed tag to the log line
func (*Logger) CompletedError ¶
CompletedError uses the Error destination and writes a Completed tag to the log line
func (*Logger) CompletedErrorf ¶
CompletedErrorf uses the Error destination and writes a Completed tag to the log line
func (*Logger) Completedf ¶
Completedf uses the Serialize destination and writes a Completed tag to the log line
func (*Logger) GinLogger ¶
func (l *Logger) GinLogger() gin.HandlerFunc
GinLogger handler function to custom gin logger
func (*Logger) LogDirectoryCleanup ¶
LogDirectoryCleanup performs all the directory cleanup and maintenance.
func (*Logger) Start ¶
Start initializes ApplicationLog and only displays the specified logging level.
func (*Logger) StartFile ¶
StartFile initializes tracelog and only displays the specified logging level and creates a file to capture writes.
func (*Logger) Started ¶
Started uses the Serialize destination and adds a Started tag to the log line
func (*Logger) Startedf ¶
Startedf uses the Serialize destination and writes a Started tag to the log line