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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址