...

Package writer

import "github.com/sirupsen/logrus/hooks/writer"
Overview
Index

Overview ▾

type Hook

Hook is a hook that writes logs of specified LogLevels to specified Writer

type Hook struct {
    Writer    io.Writer
    LogLevels []log.Level
}

func (*Hook) Fire

func (hook *Hook) Fire(entry *log.Entry) error

Fire will be called when some logging function is called with current hook It will format log entry to string and write it to appropriate writer

func (*Hook) Levels

func (hook *Hook) Levels() []log.Level

Levels define on which log levels this hook would trigger