matrus

package module
v0.0.0-...-d466331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

README

Matrus

Logrus to Matrix.org logging hook

Logging utilities for logrus -> matrix.org.

To develop on this library, you need logrus and gomatrix on your GOPATH:

go get github.com/Sirupsen/logrus
go get github.com/matrix-org/gomatrix

Documentation

Overview

Package matrus provides a matrix.org hook for logrus logging

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MHook

type MHook struct {
	AcceptedLevels []logrus.Level
	Client         *gomatrix.Client
	LoggingRoomID  string
	// contains filtered or unexported fields
}

MHook is a matrus Hook for logging messages to the specified matrix.org room MHook implements logrus.Hook interface

func New

func New(cli *gomatrix.Client, loggingRoomID string, level logrus.Level, bp int) (*MHook, error)

New instance of matrus logger hook

  • "cli" - Gomatrix client instance
  • "loggingRoomID" - The matrix.org roomID to send logging events to
  • "level" - Events at this logging level or higher will be dispatched
  • "bp" - The interval in seconds at which batches of logging events will be dispatched to matrix.org (if < 1 the batch dispatch period is set to the default of 15s)

func (*MHook) Fire

func (matrusHook *MHook) Fire(e *logrus.Entry) error

Fire queues messages to be dispatched to the matrix.org logging room

func (*MHook) Levels

func (matrusHook *MHook) Levels() []logrus.Level

Levels gets the levels at which logging events should be sent to matrix.org

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL