Documentation ¶
Index ¶
- Constants
- func FromCommonsLevel(l commons.Logger, level any) logger.LogLevel
- func NewSqlLogger(logger *commons.SlogLogger) logger.Interface
- type Config
- type LogLevel
- type Logger
- type SqlLogger
- func (s SqlLogger) Error(ctx context.Context, format string, args ...interface{})
- func (s SqlLogger) Info(ctx context.Context, format string, args ...interface{})
- func (l *SqlLogger) LogMode(level logger.LogLevel) logger.Interface
- func (l *SqlLogger) ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{})
- func (l *SqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (s SqlLogger) Warn(ctx context.Context, format string, args ...interface{})
- func (l *SqlLogger) WithLogLevel(level any) *SqlLogger
- func (l *SqlLogger) WithLogger(name string, level any) *SqlLogger
Constants ¶
View Source
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BlueBold = "\033[34;1m" MagentaBold = "\033[35;1m" RedBold = "\033[31;1m" YellowBold = "\033[33;1m" )
Variables ¶
This section is empty.
Functions ¶
func FromCommonsLevel ¶ added in v1.0.564
func NewSqlLogger ¶ added in v1.0.564
func NewSqlLogger(logger *commons.SlogLogger) logger.Interface
Types ¶
type SqlLogger ¶ added in v1.0.564
func (*SqlLogger) ParamsFilter ¶ added in v1.0.564
func (l *SqlLogger) ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{})
ParamsFilter filter params
func (*SqlLogger) Trace ¶ added in v1.0.564
func (l *SqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
Trace print sql message
func (*SqlLogger) WithLogLevel ¶ added in v1.0.564
Click to show internal directories.
Click to hide internal directories.