github.com/Aoi-hosizora/ahlib-more@v1.5.1-0.20230404072844-256112befaf6/xlogrus/README.md (about)

     1  # xlogrus
     2  
     3  ## Dependencies
     4  
     5  + xrotation
     6  + github.com/Aoi-hosizora/ahlib
     7  + github.com/sirupsen/logrus
     8  
     9  ## Documents
    10  
    11  ### Types
    12  
    13  + `type SimpleFormatterOption func`
    14  + `type SimpleFormatter struct`
    15  + `type RotationHookOption func`
    16  + `type RotationHook struct`
    17  
    18  ### Variables
    19  
    20  + None
    21  
    22  ### Constants
    23  
    24  + None
    25  
    26  ### Functions
    27  
    28  + `func WithTimestampFormat(f string) SimpleFormatterOption`
    29  + `func WithTimeLocation(loc *time.Location) SimpleFormatterOption`
    30  + `func WithDisableColor(disable bool) SimpleFormatterOption`
    31  + `func WithCallerFormatter(formatter func(*runtime.Frame) (filename string, funcname string)) SimpleFormatterOption`
    32  + `func WithLevelFormatter(formatter func(logrus.Level) string) SimpleFormatterOption`
    33  + `func WithMessageFormatter(formatter func(level, time, caller, message string) string) SimpleFormatterOption`
    34  + `func NewSimpleFormatter(options ...SimpleFormatterOption) *SimpleFormatter`
    35  + `func RFC3339JsonFormatter() *logrus.JSONFormatter`
    36  + `func RFC3339ColoredTextFormatter() *logrus.TextFormatter`
    37  + `func WithRotateFormatter(formatter logrus.Formatter) RotationHookOption`
    38  + `func WithRotateLevel(level logrus.Level) RotationHookOption`
    39  + `func NewRotationHook(rotation *xrotation.RotationLogger, options ...RotationHookOption) *RotationHook`
    40  
    41  ### Methods
    42  
    43  + `func (s *SimpleFormatter) Format(entry *logrus.Entry) ([]byte, error)`
    44  + `func (r *RotationHook) Levels() []logrus.Level`
    45  + `func (r *RotationHook) Fire(entry *logrus.Entry) error`