Versions in this module Expand all Collapse all v1 v1.1.2 Mar 20, 2024 Changes in this version + const COLOR_BLACK + const COLOR_BLUE + const COLOR_CYAN + const COLOR_GREEN + const COLOR_HI_BLACK + const COLOR_HI_BLUE + const COLOR_HI_CYAN + const COLOR_HI_GREEN + const COLOR_HI_MAGENTA + const COLOR_HI_RED + const COLOR_HI_WHITE + const COLOR_HI_YELLOW + const COLOR_MAGENTA + const COLOR_RED + const COLOR_WHITE + const COLOR_YELLOW + const DefaultName + const F_ASYNC + const F_CALLER_FN + const F_FILE_LONG + const F_FILE_SHORT + const F_TIME_DATE + const F_TIME_MILLI + const F_TIME_STD + const F_TIME_TIME + const LEVEL_ALL + const LEVEL_CRIT + const LEVEL_DEBU + const LEVEL_DEV + const LEVEL_ERRO + const LEVEL_FATA + const LEVEL_INFO + const LEVEL_NONE + const LEVEL_NOTI + const LEVEL_PANI + const LEVEL_PROD + const LEVEL_WARN + func Critical(ctx context.Context, v ...interface{}) + func Criticalf(ctx context.Context, format string, v ...interface{}) + func Debug(ctx context.Context, v ...interface{}) + func Debugf(ctx context.Context, format string, v ...interface{}) + func Error(ctx context.Context, v ...interface{}) + func Errorf(ctx context.Context, format string, v ...interface{}) + func Fatal(ctx context.Context, v ...interface{}) + func Fatalf(ctx context.Context, format string, v ...interface{}) + func GetCtxKeys() []interface + func GetFlags() int + func GetLevel() int + func GetLevelPrefix(level int) string + func GetPath() string + func GetStack(skip ...int) string + func GetWriter() io.Writer + func HandlerJson(ctx context.Context, in *HandlerInput) + func HandlerStructure(ctx context.Context, in *HandlerInput) + func Info(ctx context.Context, v ...interface{}) + func Infof(ctx context.Context, format string, v ...interface{}) + func Notice(ctx context.Context, v ...interface{}) + func Noticef(ctx context.Context, format string, v ...interface{}) + func Panic(ctx context.Context, v ...interface{}) + func Panicf(ctx context.Context, format string, v ...interface{}) + func Print(ctx context.Context, v ...interface{}) + func PrintStack(ctx context.Context, skip ...int) + func Printf(ctx context.Context, format string, v ...interface{}) + func SetAsync(enabled bool) + func SetConfig(config Config) error + func SetConfigWithMap(m map[string]interface{}) error + func SetCtxKeys(keys ...interface{}) + func SetDebug(debug bool) + func SetDefaultHandler(handler Handler) + func SetDefaultLogger(l *Logger) + func SetFile(pattern string) + func SetFlags(flags int) + func SetHandlers(handlers ...Handler) + func SetHeaderPrint(enabled bool) + func SetLevel(level int) + func SetLevelPrefix(level int, prefix string) + func SetLevelPrefixes(prefixes map[int]string) + func SetLevelStr(levelStr string) error + func SetPath(path string) error + func SetPrefix(prefix string) + func SetStack(enabled bool) + func SetStdoutPrint(enabled bool) + func SetWriter(writer io.Writer) + func SetWriterColorEnable(enabled bool) + func Warning(ctx context.Context, v ...interface{}) + func Warningf(ctx context.Context, format string, v ...interface{}) + type Config struct + CtxKeys []interface{} + File string + Flags int + Handlers []Handler + HeaderPrint bool + Level int + LevelPrefixes map[int]string + LevelPrint bool + Path string + Prefix string + RotateBackupCompress int + RotateBackupExpire time.Duration + RotateBackupLimit int + RotateCheckInterval time.Duration + RotateExpire time.Duration + RotateSize int64 + StFilter string + StSkip int + StStatus int + StdoutColorDisabled bool + StdoutPrint bool + TimeFormat string + Writer io.Writer + WriterColorEnable bool + func DefaultConfig() Config + type Handler func(ctx context.Context, in *HandlerInput) + func GetDefaultHandler() Handler + type HandlerInput struct + Buffer *bytes.Buffer + CallerFunc string + CallerPath string + Color int + Content string + CtxStr string + IsAsync bool + Level int + LevelFormat string + Logger *Logger + Prefix string + Stack string + Time time.Time + TimeFormat string + TraceId string + Values []any + func (in *HandlerInput) Next(ctx context.Context) + func (in *HandlerInput) String(withColor ...bool) string + type HandlerOutputJson struct + CallerFunc string + CallerPath string + Content string + CtxStr string + Level string + Prefix string + Stack string + Time string + TraceId string + type ILogger interface + Critical func(ctx context.Context, v ...interface{}) + Criticalf func(ctx context.Context, format string, v ...interface{}) + Debug func(ctx context.Context, v ...interface{}) + Debugf func(ctx context.Context, format string, v ...interface{}) + Error func(ctx context.Context, v ...interface{}) + Errorf func(ctx context.Context, format string, v ...interface{}) + Fatal func(ctx context.Context, v ...interface{}) + Fatalf func(ctx context.Context, format string, v ...interface{}) + Info func(ctx context.Context, v ...interface{}) + Infof func(ctx context.Context, format string, v ...interface{}) + Notice func(ctx context.Context, v ...interface{}) + Noticef func(ctx context.Context, format string, v ...interface{}) + Panic func(ctx context.Context, v ...interface{}) + Panicf func(ctx context.Context, format string, v ...interface{}) + Print func(ctx context.Context, v ...interface{}) + Printf func(ctx context.Context, format string, v ...interface{}) + Warning func(ctx context.Context, v ...interface{}) + Warningf func(ctx context.Context, format string, v ...interface{}) + type Logger struct + func Async(enabled ...bool) *Logger + func Cat(category string) *Logger + func DefaultLogger() *Logger + func Expose() *Logger + func File(pattern string) *Logger + func Header(enabled ...bool) *Logger + func Instance(name ...string) *Logger + func Level(level int) *Logger + func LevelStr(levelStr string) *Logger + func Line(long ...bool) *Logger + func New() *Logger + func NewWithWriter(writer io.Writer) *Logger + func Path(path string) *Logger + func Skip(skip int) *Logger + func Stack(enabled bool, skip ...int) *Logger + func StackWithFilter(filter string) *Logger + func Stdout(enabled ...bool) *Logger + func To(writer io.Writer) *Logger + func (l *Logger) AppendCtxKeys(keys ...interface{}) + func (l *Logger) Async(enabled ...bool) *Logger + func (l *Logger) Cat(category string) *Logger + func (l *Logger) Clone() *Logger + func (l *Logger) Critical(ctx context.Context, v ...interface{}) + func (l *Logger) Criticalf(ctx context.Context, format string, v ...interface{}) + func (l *Logger) Debug(ctx context.Context, v ...interface{}) + func (l *Logger) Debugf(ctx context.Context, format string, v ...interface{}) + func (l *Logger) Error(ctx context.Context, v ...interface{}) + func (l *Logger) Errorf(ctx context.Context, format string, v ...interface{}) + func (l *Logger) Fatal(ctx context.Context, v ...interface{}) + func (l *Logger) Fatalf(ctx context.Context, format string, v ...interface{}) + func (l *Logger) File(file string) *Logger + func (l *Logger) GetConfig() Config + func (l *Logger) GetCtxKeys() []interface{} + func (l *Logger) GetFlags() int + func (l *Logger) GetLevel() int + func (l *Logger) GetLevelPrefix(level int) string + func (l *Logger) GetPath() string + func (l *Logger) GetStack(skip ...int) string + func (l *Logger) GetWriter() io.Writer + func (l *Logger) Header(enabled ...bool) *Logger + func (l *Logger) Info(ctx context.Context, v ...interface{}) + func (l *Logger) Infof(ctx context.Context, format string, v ...interface{}) + func (l *Logger) Level(level int) *Logger + func (l *Logger) LevelStr(levelStr string) *Logger + func (l *Logger) Line(long ...bool) *Logger + func (l *Logger) Notice(ctx context.Context, v ...interface{}) + func (l *Logger) Noticef(ctx context.Context, format string, v ...interface{}) + func (l *Logger) Panic(ctx context.Context, v ...interface{}) + func (l *Logger) Panicf(ctx context.Context, format string, v ...interface{}) + func (l *Logger) Path(path string) *Logger + func (l *Logger) Print(ctx context.Context, v ...interface{}) + func (l *Logger) PrintStack(ctx context.Context, skip ...int) + func (l *Logger) Printf(ctx context.Context, format string, v ...interface{}) + func (l *Logger) SetAsync(enabled bool) + func (l *Logger) SetConfig(config Config) error + func (l *Logger) SetConfigWithMap(m map[string]interface{}) error + func (l *Logger) SetCtxKeys(keys ...interface{}) + func (l *Logger) SetDebug(debug bool) + func (l *Logger) SetFile(pattern string) + func (l *Logger) SetFlags(flags int) + func (l *Logger) SetHandlers(handlers ...Handler) + func (l *Logger) SetHeaderPrint(enabled bool) + func (l *Logger) SetLevel(level int) + func (l *Logger) SetLevelPrefix(level int, prefix string) + func (l *Logger) SetLevelPrefixes(prefixes map[int]string) + func (l *Logger) SetLevelPrint(enabled bool) + func (l *Logger) SetLevelStr(levelStr string) error + func (l *Logger) SetPath(path string) error + func (l *Logger) SetPrefix(prefix string) + func (l *Logger) SetStack(enabled bool) + func (l *Logger) SetStackFilter(filter string) + func (l *Logger) SetStackSkip(skip int) + func (l *Logger) SetStdoutColorDisabled(disabled bool) + func (l *Logger) SetStdoutPrint(enabled bool) + func (l *Logger) SetTimeFormat(timeFormat string) + func (l *Logger) SetWriter(writer io.Writer) + func (l *Logger) SetWriterColorEnable(enabled bool) + func (l *Logger) Skip(skip int) *Logger + func (l *Logger) Stack(enabled bool, skip ...int) *Logger + func (l *Logger) StackWithFilter(filter string) *Logger + func (l *Logger) Stdout(enabled ...bool) *Logger + func (l *Logger) To(writer io.Writer) *Logger + func (l *Logger) Warning(ctx context.Context, v ...interface{}) + func (l *Logger) Warningf(ctx context.Context, format string, v ...interface{}) + func (l *Logger) Write(p []byte) (n int, err error)