Documentation ¶
Overview ¶
Package servicelogger - implements a file logger for services
Index ¶
- func LogLevelToString(level LogLevel) string
- type FacilityFilter
- type FacilityFilters
- type LogLevel
- type Logger
- func (slog *Logger) AddFacilityFilter(filtername string, filterlevel LogLevel)
- func (slog *Logger) ApplyNewSettings(newFile string, newLevel LogLevel, newRotation bool, newRotSize string, ...) bool
- func (slog Logger) DumpLogFilters() FacilityFilters
- func (slog *Logger) LoadFacilityFilters(filename string) error
- func (l *Logger) LogDebug(function string, source string, text string)
- func (l *Logger) LogError(function string, source string, text string)
- func (l *Logger) LogFatal(function string, source string, text string, exitcode int)
- func (l *Logger) LogInfo(function string, source string, text string)
- func (l *Logger) LogTrace(function string, source string, text string)
- func (l *Logger) LogWarn(function string, source string, text string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogLevelToString ¶
LogLevelToString returns a string representation of the LogLevel
Types ¶
type FacilityFilter ¶
type FacilityFilter struct {
// contains filtered or unexported fields
}
type FacilityFilters ¶
type FacilityFilters struct {
// contains filtered or unexported fields
}
type LogLevel ¶
type LogLevel int
func StringToLogLevel ¶
StringToLogLevel returns a LogLevel for a provided string. When the string cannot be recognised, LL_INFO is returned
type Logger ¶
type Logger struct { MinLoglevel LogLevel // contains filtered or unexported fields }
func New ¶
func New(prefix string, filename string, minloglevel LogLevel, rotate bool, rotatesize string, keep int) (l Logger, err error)
New returns a new Logger object
func (*Logger) AddFacilityFilter ¶
func (*Logger) ApplyNewSettings ¶
func (Logger) DumpLogFilters ¶
func (slog Logger) DumpLogFilters() FacilityFilters
func (*Logger) LoadFacilityFilters ¶
func (*Logger) LogFatal ¶
LogFata logs a message at FATAL level and exits the application with the provided exit code
Click to show internal directories.
Click to hide internal directories.