Documentation
¶
Index ¶
- func Debug(f string, a ...interface{})
- func DisableLogs()
- func EnableLogs()
- func Error(f string, a ...interface{})
- func Fatal(f string, a ...interface{})
- func GinMiddleware() gin.HandlerFunc
- func GinRecovery() gin.HandlerFunc
- func Info(f string, a ...interface{})
- func LogRequestError(c *gin.Context, format string, args ...interface{})
- func LogRequestInfo(c *gin.Context, format string, args ...interface{})
- func LogRequestSecurity(c *gin.Context, format string, args ...interface{})
- func LogRequestWarn(c *gin.Context, format string, args ...interface{})
- func RegisterRoute(group *gin.RouterGroup, method, path string, handler gin.HandlerFunc, ...)
- func RegisterRouteWithConfig(group *gin.RouterGroup, method, path string, handler gin.HandlerFunc, ...)
- func RegisterRoutes(group *gin.RouterGroup, routes []Route)
- func Security(f string, a ...interface{})
- func SetDefault(l *Logger)
- func Success(f string, a ...interface{})
- func Warn(f string, a ...interface{})
- type AppLog
- type Config
- type ConsoleWriter
- type DBWriter
- type Entry
- type Fields
- type FileWriter
- type Level
- type Logger
- func (l *Logger) AddWriter(w Writer)
- func (l *Logger) Clone() *Logger
- func (l *Logger) Close() error
- func (l *Logger) Debug(f string, a ...interface{})
- func (l *Logger) Error(f string, a ...interface{})
- func (l *Logger) Fatal(f string, a ...interface{})
- func (l *Logger) Info(f string, a ...interface{})
- func (l *Logger) Security(f string, a ...interface{})
- func (l *Logger) SetMinLevel(level Level)
- func (l *Logger) Success(f string, a ...interface{})
- func (l *Logger) Warn(f string, a ...interface{})
- func (l *Logger) WithContext(ctx context.Context) *Logger
- func (l *Logger) WithFields(fields Fields) *Logger
- func (l *Logger) WithRequest(endpoint, ip string) *Logger
- func (l *Logger) WithUser(userID uuid.UUID) *Logger
- type Route
- type RouteConfig
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLogs ¶
func DisableLogs()
func EnableLogs ¶
func EnableLogs()
func GinMiddleware ¶
func GinMiddleware() gin.HandlerFunc
GinMiddleware middleware global de logging (usa logger global)
func GinRecovery ¶
func GinRecovery() gin.HandlerFunc
func LogRequestError ¶
func LogRequestInfo ¶
func LogRequestSecurity ¶
func LogRequestWarn ¶
func RegisterRoute ¶
func RegisterRoute(group *gin.RouterGroup, method, path string, handler gin.HandlerFunc, protected bool)
RegisterRoute registra una ruta y la loguea
func RegisterRouteWithConfig ¶
func RegisterRouteWithConfig(group *gin.RouterGroup, method, path string, handler gin.HandlerFunc, protected bool, cfg RouteConfig)
RegisterRouteWithConfig registra una ruta con config personalizada
func RegisterRoutes ¶
func RegisterRoutes(group *gin.RouterGroup, routes []Route)
RegisterRoutes registra múltiples rutas
Types ¶
type ConsoleWriter ¶
type ConsoleWriter struct {
// contains filtered or unexported fields
}
func NewConsoleWriter ¶
func NewConsoleWriter(enableColors bool) *ConsoleWriter
func (*ConsoleWriter) Close ¶
func (w *ConsoleWriter) Close() error
func (*ConsoleWriter) Write ¶
func (w *ConsoleWriter) Write(entry *Entry) error
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func NewFileWriter ¶
func NewFileWriter(path string) (*FileWriter, error)
func (*FileWriter) Close ¶
func (w *FileWriter) Close() error
func (*FileWriter) Write ¶
func (w *FileWriter) Write(entry *Entry) error
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func InitGlobal ¶
func WithContext ¶
func WithFields ¶
func WithRequest ¶
func (*Logger) SetMinLevel ¶
func (*Logger) WithFields ¶
func (*Logger) WithRequest ¶
type Route ¶
type Route struct {
Method string
Path string
Handler gin.HandlerFunc
Protected bool
}
Route representa una ruta a registrar
type RouteConfig ¶
Click to show internal directories.
Click to hide internal directories.