simplelogger

package
v0.0.0-...-7884915 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_EXTENSION = ".log"
	CMD_STRING    = "cmd"
	DATA_STRING   = "data"
	CASE_DEBUG    = "debug"
	CASE_WARN     = "warn"
	CASE_INFO     = "info"
	CASE_ERROR    = "error"
	CASE_DEBUGF   = "debugf"
	CASE_WARNF    = "warnf"
	CASE_INFOF    = "infof"
	CASE_ERRORF   = "errorf"
)

Variables

This section is empty.

Functions

func RandomSessionID

func RandomSessionID() string

Generates Random session string

Types

type AppLogger

type AppLogger struct {

	//inherit from interface
	sli.IAppLogger

	Log     sli.ISimpleLogger `json:"-"`
	Started bool              `json:"-"`
}

func (AppLogger) FinishLogging

func (al AppLogger) FinishLogging() []error

the logging functions are here

func (AppLogger) LogDebug

func (al AppLogger) LogDebug(cmd string, data ...interface{})

the logging functions are here

func (AppLogger) LogDebugf

func (al AppLogger) LogDebugf(cmd string, msg string, data ...interface{})

the logging functions are here

func (AppLogger) LogError

func (al AppLogger) LogError(cmd string, data ...interface{})

func (AppLogger) LogErrorE

func (al AppLogger) LogErrorE(cmd string, data error)

This Log error allows errors to be logged .Error() is the data written

func (AppLogger) LogErrorEf

func (al AppLogger) LogErrorEf(cmd string, msg string, e error)

This Log error allows errors to be logged .Error() is the data written

func (AppLogger) LogErrorf

func (al AppLogger) LogErrorf(cmd string, msg string, data ...interface{})

func (AppLogger) LogInfo

func (al AppLogger) LogInfo(cmd string, data ...interface{})

func (AppLogger) LogInfof

func (al AppLogger) LogInfof(cmd string, msg string, data ...interface{})

func (AppLogger) LogWarn

func (al AppLogger) LogWarn(cmd string, data ...interface{})

func (AppLogger) LogWarnf

func (al AppLogger) LogWarnf(cmd string, msg string, data ...interface{})

func (AppLogger) StartLogging

func (al AppLogger) StartLogging() []error

the logging functions are here

type SimpleChannel

type SimpleChannel struct {

	//inherit from interface
	sli.ISimpleChannel
	// contains filtered or unexported fields
}

Simple Channel represents and output channel to be logged to kitlog does the hard work this simply wraps

func (SimpleChannel) Close

func (sc SimpleChannel) Close() error

func (SimpleChannel) GetDetails

func (sc SimpleChannel) GetDetails() string

func (SimpleChannel) GetLog

func (sc SimpleChannel) GetLog() kitlog.Logger

func (SimpleChannel) GetLogLevel

func (sc SimpleChannel) GetLogLevel() kitlevel.Option

func (SimpleChannel) GetSessionID

func (sc SimpleChannel) GetSessionID() string

func (SimpleChannel) Open

func (sc SimpleChannel) Open() (sli.ISimpleChannel, error)

func (SimpleChannel) SetLog

func (sc SimpleChannel) SetLog(log kitlog.Logger)

func (SimpleChannel) SetLogLevel

func (sc SimpleChannel) SetLogLevel(lvl kitlevel.Option)

func (SimpleChannel) SetSessionID

func (sc SimpleChannel) SetSessionID(sessionid string)

type SimpleLogger

type SimpleLogger struct {

	//inherit from interface
	sli.ISimpleLogger
	// contains filtered or unexported fields
}

func NewAppSessionDayLogger

func NewAppSessionDayLogger(sessionid string) SimpleLogger

func NewAppSessionNowLogger

func NewAppSessionNowLogger(sessionid string) SimpleLogger

func NewApplicationDayLogger

func NewApplicationDayLogger() SimpleLogger

func NewApplicationLogger

func NewApplicationLogger() SimpleLogger

This is the simplest application log generator The os.args[0] is used for filename and the session is random

func NewApplicationNowLogger

func NewApplicationNowLogger() SimpleLogger

func NewApplicationSessionLogger

func NewApplicationSessionLogger(sessionid string) SimpleLogger

This is application log generator when the session is required The os.args[0] is used for filename

func NewSimpleLogger

func NewSimpleLogger(filename string, sessionid string) SimpleLogger

This lets you specify the filename and the session

func (SimpleLogger) AddChannel

func (ssl SimpleLogger) AddChannel(log sli.ISimpleChannel)

func (SimpleLogger) CloseAllChannels

func (ssl SimpleLogger) CloseAllChannels() []error

func (SimpleLogger) CloseChannel

func (ssl SimpleLogger) CloseChannel(sessionid string) []error

func (SimpleLogger) GetChannel

func (ssl SimpleLogger) GetChannel(sessionid string) sli.ISimpleChannel

func (SimpleLogger) GetChannelLogLevel

func (ssl SimpleLogger) GetChannelLogLevel(sessionid string) kitlevel.Option

func (SimpleLogger) GetChannels

func (ssl SimpleLogger) GetChannels() map[string]sli.ISimpleChannel

func (SimpleLogger) GetLogLevel

func (ssl SimpleLogger) GetLogLevel() kitlevel.Option

func (SimpleLogger) GetPrintToScreen

func (ssl SimpleLogger) GetPrintToScreen() sli.PrintLevel

func (SimpleLogger) GetSessionIDs

func (ssl SimpleLogger) GetSessionIDs() []string

func (SimpleLogger) LogDebug

func (ssl SimpleLogger) LogDebug(cmd string, data ...interface{})

the logging functions are here

func (SimpleLogger) LogDebugf

func (ssl SimpleLogger) LogDebugf(cmd string, msg string, data ...interface{})

the logging functions are here

func (SimpleLogger) LogError

func (ssl SimpleLogger) LogError(cmd string, data ...interface{})

func (SimpleLogger) LogErrorE

func (ssl SimpleLogger) LogErrorE(cmd string, e error)

This Log error allows errors to be logged .Error() is the data written

func (SimpleLogger) LogErrorEf

func (ssl SimpleLogger) LogErrorEf(cmd string, msg string, e error)

This Log error allows errors to be logged where .Error() will be passed into the string

func (SimpleLogger) LogErrorf

func (ssl SimpleLogger) LogErrorf(cmd string, msg string, data ...interface{})

func (SimpleLogger) LogInfo

func (ssl SimpleLogger) LogInfo(cmd string, data ...interface{})

func (SimpleLogger) LogInfof

func (ssl SimpleLogger) LogInfof(cmd string, msg string, data ...interface{})

func (SimpleLogger) LogWarn

func (ssl SimpleLogger) LogWarn(cmd string, data ...interface{})

func (SimpleLogger) LogWarnf

func (ssl SimpleLogger) LogWarnf(cmd string, msg string, data ...interface{})

func (SimpleLogger) OpenAllChannels

func (ssl SimpleLogger) OpenAllChannels() []error

func (SimpleLogger) OpenChannel

func (ssl SimpleLogger) OpenChannel(sessionid string) []error

func (SimpleLogger) OpenSessionFileLog

func (ssl SimpleLogger) OpenSessionFileLog(logfilename string, sessionid string) error

func (SimpleLogger) PrintDetails

func (ssl SimpleLogger) PrintDetails()

func (SimpleLogger) SetChannelLogLevel

func (ssl SimpleLogger) SetChannelLogLevel(sessionid string, lvl kitlevel.Option)

func (SimpleLogger) SetLogLevel

func (ssl SimpleLogger) SetLogLevel(lvl kitlevel.Option)

func (SimpleLogger) SetPrintToScreen

func (ssl SimpleLogger) SetPrintToScreen(toggle sli.PrintLevel)

type SimpleOutput

type SimpleOutput struct {

	//inherit from interface
	sli.ISimpleOutput
	// contains filtered or unexported fields
}

Simple Output represents an output to be logged to

func (SimpleOutput) Close

func (so SimpleOutput) Close() error

func (SimpleOutput) GetDetails

func (so SimpleOutput) GetDetails() string

func (SimpleOutput) GetSessionID

func (so SimpleOutput) GetSessionID() string

func (SimpleOutput) Open

func (so SimpleOutput) Open() (sli.ISimpleOutput, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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