polarisb_syslog_go

package module
v1.0.0-pre-release Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 4 Imported by: ? 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

polarisb-syslog-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Time     time.Time
	LogLevel LogLevel
	Event    interface{}
	Message  string
	Actor    string
	MoreInfo map[string]interface{}
	// contains filtered or unexported fields
}

type LogEntryFmt

type LogEntryFmt struct {
	NumberOfLinesAfter int
}

type LogLevel

type LogLevel int64
const (
	Debug       LogLevel = iota
	Information          // Use this for normal logging
	Warning              // Use this for logging that is not an error, but may be a problem
	Error                // Use this for logging that is an error
	Fatal                // Use this for logging that is a fatal error

	Success  // Use this for logging that is a success
	Failure  // Use this for logging that is a failure
	Critical // Use this for logging that is a critical failure, but can also be a warning
)

func (LogLevel) String

func (level LogLevel) String() string

type LogSink

type LogSink struct {
	Channel                *LogSinkChannel
	WriteToConsoleSettings *WriteToConsoleSettings
	// contains filtered or unexported fields
}

func AddPolarisbSystemLog

func AddPolarisbSystemLog() (logSink *LogSink)

AddPolarisbSystemLog initializes the log sink

func (*LogSink) Close

func (logSink *LogSink) Close()

Close Called at program exit

func (*LogSink) LogThis

func (logSink *LogSink) LogThis(logLevel LogLevel, event interface{}, message string, actor string)

LogThis builds a log entry and sends it to the log sink

func (*LogSink) LogThisWithMoreInfo

func (logSink *LogSink) LogThisWithMoreInfo(logLevel LogLevel, event interface{}, message string, actor string, moreInfo map[string]interface{})

LogThisWithMoreInfo builds a log entry with more info

func (*LogSink) LogThisWithMoreInfoAndFmt

func (logSink *LogSink) LogThisWithMoreInfoAndFmt(logLevel LogLevel, event interface{}, message string, actor string, moreInfo map[string]interface{}, entryFmt LogEntryFmt)

LogThisWithMoreInfoAndFmt builds a log entry with more info and fmt information

func (*LogSink) LogWrite

func (logSink *LogSink) LogWrite(logEntry *LogEntry)

LogWrite writes a log entry to the log sink

func (*LogSink) WriteToConsole

func (logSink *LogSink) WriteToConsole() *LogSink

WriteToConsole Enables writes to the console

type LogSinkChannel

type LogSinkChannel struct {
	SinkChannel chan *LogEntry
	WaitGroup   *sync.WaitGroup
}

func (*LogSinkChannel) CloseChannel

func (logSink *LogSinkChannel) CloseChannel()

CloseChannel Close sink channel

type WriteToConsoleSettings

type WriteToConsoleSettings struct {
	KeyColor   string
	ValueColor string
}

func (*WriteToConsoleSettings) SetWriteToConsoleSettings

func (settings *WriteToConsoleSettings) SetWriteToConsoleSettings(newSettings *WriteToConsoleSettings)

SetWriteToConsoleSettings allows setting write to console settings

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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