logger

package
v0.0.0-...-2fd186a Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2017 License: MIT Imports: 4 Imported by: 14

Documentation

Index

Constants

View Source
const SystemErrorTag = "SYSTEM_ERROR"

SystemErrorTag is the identifying name for system errors in the log files

View Source
const SystemLogTag = "SYSTEM_LOG_INFO"

SystemLogTag is the identifying name for system messages in the log files

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLogSave

type FileLogSave struct {
	LogFileName string
	LogFileDir  string
}

FileLogSave is a logging system that saves log data in a new log file

func (FileLogSave) SaveLogData

func (logSave FileLogSave) SaveLogData(data string)

SaveLogData in FileLogSave will save any logged info/erros into a log file on the local file system

type Log

type Log interface {
	Info(message string) string
	Error(message string) string
}

Log is the abstraction for sending and collecting log data from the system

type LogSave

type LogSave interface {
	SaveLogData(message string)
}

LogSave is the main system to specify how to save log information

type Logger

type Logger struct {
	LogSave LogSave
}

Logger is the main interface struct for different types of loggin

type SystemLogger

type SystemLogger Logger

SystemLogger is log data directly from the underlying running system

func NewSystemLogger

func NewSystemLogger(logSave LogSave) *SystemLogger

NewSystemLogger returns a new logger of type system

func (SystemLogger) Error

func (log SystemLogger) Error(data string) string

Error system log returns error data in the format SYSTEM_ERROR, time, message

func (SystemLogger) Info

func (log SystemLogger) Info(data string) string

Info system log info returns data in the format SYSTEM_LOG_INFO, time, message

Jump to

Keyboard shortcuts

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