Documentation ¶
Index ¶
- Constants
- Variables
- func IsDebugEnabled() bool
- func IsErrorEnabled() bool
- func IsFatalEnabled() bool
- func IsInfoEnabled() bool
- func IsPanicEnabled() bool
- func IsPrintEnabled() bool
- func IsWarnEnabled() bool
- func Reconfigure(options ...LoggerOption)
- func SetLevel(level Level)
- type Addition
- type IAddition
- func Debug(message interface{}) IAddition
- func Debugf(format string, arguments ...interface{}) IAddition
- func Error(message interface{}) IAddition
- func Errorf(format string, arguments ...interface{}) IAddition
- func Fatal(message interface{}) IAddition
- func Fatalf(format string, arguments ...interface{}) IAddition
- func Info(message interface{}) IAddition
- func Infof(format string, arguments ...interface{}) IAddition
- func NewAddition(message string) IAddition
- func Panic(message interface{}) IAddition
- func Panicf(format string, arguments ...interface{}) IAddition
- func Print(message interface{}) IAddition
- func Printf(format string, arguments ...interface{}) IAddition
- func Warn(message interface{}) IAddition
- func Warnf(format string, arguments ...interface{}) IAddition
- type ILogger
- func NewLogDefault(service string, level Level) ILogger
- func NewLogger(options ...LoggerOption) ILogger
- func NewLoggerEmpty(level Level) ILogger
- func With(prefixes, tags, fields, sufixes map[string]interface{}) ILogger
- func WithField(key string, value interface{}) ILogger
- func WithFields(fields map[string]interface{}) ILogger
- func WithPrefix(key string, value interface{}) ILogger
- func WithPrefixes(prefixes map[string]interface{}) ILogger
- func WithSufix(key string, value interface{}) ILogger
- func WithSufixes(sufixes map[string]interface{}) ILogger
- func WithTag(key string, value interface{}) ILogger
- func WithTags(tags map[string]interface{}) ILogger
- type ISpecialWriter
- type Level
- type Logger
- func (logger *Logger) Debug(message interface{}) IAddition
- func (logger *Logger) Debugf(format string, arguments ...interface{}) IAddition
- func (logger *Logger) Error(message interface{}) IAddition
- func (logger *Logger) Errorf(format string, arguments ...interface{}) IAddition
- func (logger *Logger) Fatal(message interface{}) IAddition
- func (logger *Logger) Fatalf(format string, arguments ...interface{}) IAddition
- func (logger *Logger) Info(message interface{}) IAddition
- func (logger *Logger) Infof(format string, arguments ...interface{}) IAddition
- func (logger *Logger) IsDebugEnabled() bool
- func (logger *Logger) IsErrorEnabled() bool
- func (logger *Logger) IsFatalEnabled() bool
- func (logger *Logger) IsInfoEnabled() bool
- func (logger *Logger) IsPanicEnabled() bool
- func (logger *Logger) IsPrintEnabled() bool
- func (logger *Logger) IsWarnEnabled() bool
- func (logger *Logger) Panic(message interface{}) IAddition
- func (logger *Logger) Panicf(format string, arguments ...interface{}) IAddition
- func (logger *Logger) Print(message interface{}) IAddition
- func (logger *Logger) Printf(format string, arguments ...interface{}) IAddition
- func (logger *Logger) Reconfigure(options ...LoggerOption)
- func (logger *Logger) SetLevel(level Level)
- func (logger *Logger) Warn(message interface{}) IAddition
- func (logger *Logger) Warnf(format string, arguments ...interface{}) IAddition
- func (logger *Logger) With(prefixes, tags, fields, sufixes map[string]interface{}) ILogger
- func (logger *Logger) WithField(key string, value interface{}) ILogger
- func (logger *Logger) WithFields(fields map[string]interface{}) ILogger
- func (logger *Logger) WithPrefix(key string, value interface{}) ILogger
- func (logger *Logger) WithPrefixes(prefixes map[string]interface{}) ILogger
- func (logger *Logger) WithSufix(key string, value interface{}) ILogger
- func (logger *Logger) WithSufixes(sufixes map[string]interface{}) ILogger
- func (logger *Logger) WithTag(key string, value interface{}) ILogger
- func (logger *Logger) WithTags(tags map[string]interface{}) ILogger
- type LoggerOption
- func WithFormatHandler(formatHandler writer.FormatHandler) LoggerOption
- func WithLevel(level Level) LoggerOption
- func WithOptField(key string, value interface{}) LoggerOption
- func WithOptFields(fields map[string]interface{}) LoggerOption
- func WithOptPrefix(key string, value interface{}) LoggerOption
- func WithOptPrefixes(prefixes map[string]interface{}) LoggerOption
- func WithOptTag(key string, value interface{}) LoggerOption
- func WithOptTags(tags map[string]interface{}) LoggerOption
- func WithOptions(prefixes, tags, fields map[string]interface{}) LoggerOption
- func WithSpecialWriter(writer ...ISpecialWriter) LoggerOption
- func WithWriter(writer ...io.Writer) LoggerOption
- type Prefix
Constants ¶
View Source
const ( LevelDefault = LevelInfo // LevelDefault Level LevelNone Level = iota // LevelNone, when the logging is disabled LevelPrint // LevelPrint, when it is a system message LevelPanic // LevelPanic, when there is no recover LevelFatal // LevelFatal, when the error is fatal to the application LevelError // LevelError, when there is a controlled error LevelWarn // LevelWarn, when there is a warning LevelInfo // LevelInfo, when it is a informational message LevelDebug // LevelDebug, when it is a debugging message // Special Prefixes LEVEL Prefix = "{{LEVEL}}" // Add the level value to the prefix TIMESTAMP Prefix = "{{TIMESTAMP}}" // Add the timestamp value to the prefix DATE Prefix = "{{DATE}}" // Add the date value to the prefix TIME Prefix = "{{TIME}}" // Add the time value to the prefix IP Prefix = "{{IP}}" // Add the client ip address TRACE Prefix = "{{TRACE}}" // Add the error trace PACKAGE Prefix = "{{PACKAGE}}" // Add the package name FILE Prefix = "{{FILE}}" // Add the file FUNCTION Prefix = "{{FUNCTION}}" // Add the function name STACK Prefix = "{{STACK}}" // Add the debug stack )
Variables ¶
View Source
var Instance = NewLoggerEmpty(LevelInfo)
Functions ¶
func IsDebugEnabled ¶
func IsDebugEnabled() bool
func IsErrorEnabled ¶
func IsErrorEnabled() bool
func IsFatalEnabled ¶
func IsFatalEnabled() bool
func IsInfoEnabled ¶
func IsInfoEnabled() bool
func IsPanicEnabled ¶
func IsPanicEnabled() bool
func IsPrintEnabled ¶
func IsPrintEnabled() bool
func IsWarnEnabled ¶
func IsWarnEnabled() bool
func Reconfigure ¶
func Reconfigure(options ...LoggerOption)
Types ¶
type ILogger ¶
type ILogger interface { SetLevel(level Level) With(prefixes, tags, fields, sufixes map[string]interface{}) ILogger WithPrefixes(prefixes map[string]interface{}) ILogger WithTags(tags map[string]interface{}) ILogger WithFields(fields map[string]interface{}) ILogger WithSufixes(sufixes map[string]interface{}) ILogger WithPrefix(key string, value interface{}) ILogger WithTag(key string, value interface{}) ILogger WithField(key string, value interface{}) ILogger WithSufix(key string, value interface{}) ILogger Debug(message interface{}) IAddition Info(message interface{}) IAddition Warn(message interface{}) IAddition Error(message interface{}) IAddition Panic(message interface{}) IAddition Fatal(message interface{}) IAddition Print(message interface{}) IAddition Debugf(format string, arguments ...interface{}) IAddition Infof(format string, arguments ...interface{}) IAddition Warnf(format string, arguments ...interface{}) IAddition Errorf(format string, arguments ...interface{}) IAddition Panicf(format string, arguments ...interface{}) IAddition Fatalf(format string, arguments ...interface{}) IAddition Printf(format string, arguments ...interface{}) IAddition IsDebugEnabled() bool IsInfoEnabled() bool IsWarnEnabled() bool IsErrorEnabled() bool IsPanicEnabled() bool IsFatalEnabled() bool IsPrintEnabled() bool Reconfigure(options ...LoggerOption) }
func WithFields ¶
func WithPrefix ¶
func WithPrefixes ¶
func WithSufixes ¶
type ISpecialWriter ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger ...
func (*Logger) IsDebugEnabled ¶
func (*Logger) IsErrorEnabled ¶
func (*Logger) IsFatalEnabled ¶
func (*Logger) IsInfoEnabled ¶
func (*Logger) IsPanicEnabled ¶
func (*Logger) IsPrintEnabled ¶
func (*Logger) IsWarnEnabled ¶
func (*Logger) Reconfigure ¶
func (logger *Logger) Reconfigure(options ...LoggerOption)
Reconfigure ...
func (*Logger) WithFields ¶
func (*Logger) WithPrefix ¶
func (*Logger) WithPrefixes ¶
func (*Logger) WithSufixes ¶
type LoggerOption ¶
type LoggerOption func(log *Logger)
LoggerOption ...
func WithFormatHandler ¶
func WithFormatHandler(formatHandler writer.FormatHandler) LoggerOption
WithFormatHandler ...
func WithOptField ¶
func WithOptField(key string, value interface{}) LoggerOption
func WithOptFields ¶
func WithOptFields(fields map[string]interface{}) LoggerOption
func WithOptPrefix ¶
func WithOptPrefix(key string, value interface{}) LoggerOption
func WithOptPrefixes ¶
func WithOptPrefixes(prefixes map[string]interface{}) LoggerOption
func WithOptTag ¶
func WithOptTag(key string, value interface{}) LoggerOption
func WithOptTags ¶
func WithOptTags(tags map[string]interface{}) LoggerOption
func WithOptions ¶
func WithOptions(prefixes, tags, fields map[string]interface{}) LoggerOption
func WithSpecialWriter ¶
func WithSpecialWriter(writer ...ISpecialWriter) LoggerOption
WithSpecialWriter ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.