gophish: Index | Files

package logger

import ""

Package logger contains a wrapper around logrus to support a centralized logging config.


Package Files

doc.go logger.go


var ErrInvalidLevel = errors.New("invalid log level")

ErrInvalidLevel is returned when an invalid log level is given in the config

var Logger *logrus.Logger

Logger is the main logger that is abstracted in this package. It is exported here for use with gorm.

func Debug Uses

func Debug(args ...interface{})

Debug logs a debug message

func Debugf Uses

func Debugf(format string, args ...interface{})

Debugf logs a formatted debug messsage

func Error Uses

func Error(args ...interface{})

Error logs an error message

func Errorf Uses

func Errorf(format string, args ...interface{})

Errorf logs a formatted error message

func Fatal Uses

func Fatal(args ...interface{})

Fatal logs a fatal error message

func Fatalf Uses

func Fatalf(format string, args ...interface{})

Fatalf logs a formatted fatal error message

func Info Uses

func Info(args ...interface{})

Info logs an informational message

func Infof Uses

func Infof(format string, args ...interface{})

Infof logs a formatted informational message

func Setup Uses

func Setup(config *Config) error

Setup configures the logger based on options in the config.json.

func Warn Uses

func Warn(args ...interface{})

Warn logs a warning message

func Warnf Uses

func Warnf(format string, args ...interface{})

Warnf logs a formatted warning message

func WithFields Uses

func WithFields(fields logrus.Fields) *logrus.Entry

WithFields returns a new log enty with the provided fields

func Writer Uses

func Writer() *io.PipeWriter

Writer returns the current logging writer

type Config Uses

type Config struct {
    Filename string `json:"filename"`
    Level    string `json:"level"`

Config represents configuration details for logging.

Package logger imports 4 packages (graph) and is imported by 45 packages. Updated 2020-01-17. Refresh now. Tools for package owners.