Documentation
¶
Index ¶
- Constants
- Variables
- func IgnoreError(err error) (ignore bool)
- func IsLoggingSkipped(e *logrus.Entry) bool
- func NewDefaultMaskLogHook() logrus.Hook
- func SkipLogging(e *logrus.Entry)
- type ContextCauseHook
- type Factory
- type FormatHook
- type Level
- type Logger
- type LoggingSkippable
- type MaskPattern
- type PlainMaskPattern
- type RegexMaskPattern
- type SkipLoggingHook
- type StackHook
- type WriterHook
Constants ¶
View Source
const DefaultLevel = LevelWarn
View Source
const KeySkipLogging = "__authgear_skip_logging"
Variables ¶
View Source
var Null = logrus.NewEntry(&logrus.Logger{Out: ioutil.Discard, Formatter: nullFormatter{}})
View Source
var StackHookLevels = []logrus.Level{ logrus.PanicLevel, logrus.FatalLevel, logrus.ErrorLevel, }
Functions ¶
func IgnoreError ¶
func IsLoggingSkipped ¶
func NewDefaultMaskLogHook ¶
func SkipLogging ¶
Types ¶
type ContextCauseHook ¶
type ContextCauseHook struct{}
ContextCauseHook attaches context.Cause.
func (*ContextCauseHook) Levels ¶
func (h *ContextCauseHook) Levels() []logrus.Level
type FormatHook ¶
type FormatHook struct { MaskPatterns []MaskPattern Mask string }
func (*FormatHook) Levels ¶
func (h *FormatHook) Levels() []logrus.Level
type LoggingSkippable ¶
type LoggingSkippable interface{ SkipLogging() bool }
type MaskPattern ¶
type PlainMaskPattern ¶
type PlainMaskPattern struct {
Pattern string
}
func NewPlainMaskPattern ¶
func NewPlainMaskPattern(s string) PlainMaskPattern
type RegexMaskPattern ¶
func NewRegexMaskPattern ¶
func NewRegexMaskPattern(expr string) RegexMaskPattern
type SkipLoggingHook ¶
type SkipLoggingHook struct{}
func (SkipLoggingHook) Levels ¶
func (SkipLoggingHook) Levels() []logrus.Level
type StackHook ¶
type StackHook struct{}
StackHook attaches call stack to entries with level >= error.
type WriterHook ¶
WriterHook replaces logger.Out. Since logger.Out works with logger.Formatter, We have to replicate the behavior here. The reason for WriterHook to exist is to call our Ignore() to filter out unwanted entry.
func NewWriterHook ¶
func NewWriterHook(w io.Writer) *WriterHook
func (*WriterHook) Levels ¶
func (h *WriterHook) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.