Documentation ¶
Index ¶
- Constants
- Variables
- func DebugPrint(msg string)
- func GetLastLines(n int) []string
- func GetProfileFilePath() string
- func InitLoggerOutputs()
- func InitProduction()
- func InitTest(tb zaptest.TestingT)
- func LogAzureAPIStart(operation string)
- func LogInitialization(msg string)
- func LogPanic(rec interface{})
- func RecoverAndLog(f func())
- func SetGlobalLogger(logger *Logger)
- func SetLevel(level zapcore.Level)
- func SetLogLevel(level string)
- func SetOutputFormat(format string)
- func WriteProfileInfo(info string)
- func WriteToDebugLog(message string)
- type Field
- type LevelEnablerFunc
- type Logger
- func (l *Logger) Debug(msg string, fields ...zap.Field)
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(msg string, fields ...zap.Field)
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(msg string, fields ...zap.Field)
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Info(msg string, fields ...zap.Field)
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) SetVerbose(verbose bool)
- func (l *Logger) Sync() error
- func (l *Logger) Warn(msg string, fields ...zap.Field)
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) With(fields ...zap.Field) *Logger
Constants ¶
View Source
const ( LogFilePermissions = 0600 DebugFilePermissions = 0600 InfoLogLevel = "info" ProfileFilePermissions = 0600 )
Variables ¶
View Source
var ( DEBUG zapcore.Level = zapcore.DebugLevel INFO zapcore.Level = zapcore.InfoLevel WARN zapcore.Level = zapcore.WarnLevel ERROR zapcore.Level = zapcore.ErrorLevel GlobalEnableConsoleLogger bool GlobalEnableFileLogger bool GlobalEnableBufferLogger bool GlobalLogPath string = "/tmp/andaime.log" GlobalLogLevel string = InfoLogLevel GlobalInstantSync bool GlobalLoggedBuffer strings.Builder GlobalLoggedBufferSize int = 8192 GlobalLogFile *os.File )
View Source
var ( ZapString = zap.String ZapInt = zap.Int ZapFloat64 = zap.Float64 ZapBool = zap.Bool ZapError = zap.Error ZapAny = zap.Any )
Common field constructors
Functions ¶
func DebugPrint ¶
func DebugPrint(msg string)
func GetLastLines ¶
func GetProfileFilePath ¶
func GetProfileFilePath() string
func InitLoggerOutputs ¶
func InitLoggerOutputs()
func InitProduction ¶
func InitProduction()
func LogAzureAPIStart ¶
func LogAzureAPIStart(operation string)
LogAzureAPIStart logs the start of an Azure API operation
func LogInitialization ¶
func LogInitialization(msg string)
func RecoverAndLog ¶
func RecoverAndLog(f func())
RecoverAndLog wraps a function with panic recovery and logging
func SetGlobalLogger ¶
func SetGlobalLogger(logger *Logger)
SetGlobalLogger sets the global logger instance
func SetOutputFormat ¶
func SetOutputFormat(format string)
SetOutputFormat sets the output format for the logger
func WriteProfileInfo ¶
func WriteProfileInfo(info string)
func WriteToDebugLog ¶
func WriteToDebugLog(message string)
Types ¶
type LevelEnablerFunc ¶
LevelEnablerFunc is a wrapper to implement zapcore.LevelEnabler
type Logger ¶
Logger is a wrapper around zap.Logger
func NewTestLogger ¶
NewTestLogger creates a new Logger instance for testing
func (*Logger) SetVerbose ¶
Click to show internal directories.
Click to hide internal directories.