LogServer

package
v0.0.0-...-a93fc24 Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: GPL-2.0 Imports: 8 Imported by: 12

Documentation

Index

Constants

View Source
const TableName = "logs"

TableName is the name of the table within influxdb

Variables

This section is empty.

Functions

func SeverityToString

func SeverityToString(s factorlog.Severity) string

SeverityToString converts the Severity to human readable string

Types

type LogMessage

type LogMessage struct {
	Timestamp time.Time
	Source    string
	Severity  factorlog.Severity
	Message   string
	Event     Event.Event
}

LogMessage represents a single Message which can be send over network

func NewDebugLogMessage

func NewDebugLogMessage(source, message string) *LogMessage

NewDebugLogMessage constructs a new LogMessage with level debug

func NewErrorLogMessage

func NewErrorLogMessage(source, message string) *LogMessage

NewErrorLogMessage constructs a new LogMessage with level error

func NewInfoLogMessage

func NewInfoLogMessage(source, message string) *LogMessage

NewInfoLogMessage constructs a new LogMessage with level info

func NewLogMessage

func NewLogMessage(source, message string, level factorlog.Severity) *LogMessage

NewLogMessage constructs a new LogMessage

func NewWarnLogMessage

func NewWarnLogMessage(source, message string) *LogMessage

NewWarnLogMessage constructs a new LogMessage with level warn

func (*LogMessage) String

func (message *LogMessage) String() string

String prints the message human readable

type Server

type Server struct {
	LogQueue chan LogMessage

	InfluxClient client.Client
	// contains filtered or unexported fields
}

Server receives LogMessages and does something with them

func NewLogServer

func NewLogServer() *Server

NewLogServer constructs a new LogServer

func (Server) IsRunning

func (log Server) IsRunning() bool

IsRunning returns true if the daemon is running

func (Server) Start

func (log Server) Start()

Start starts the LogServer

func (Server) Stop

func (log Server) Stop()

Stop stops the LogServer

Jump to

Keyboard shortcuts

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