Documentation ¶
Overview ¶
Terminal colors used by the logger
Actions logger will take regarding physical log files on disk ¶
Logging level constants ¶
Logging output modes
Index ¶
- type Logger
- func (logger *Logger) Debug(logText string)
- func (logger *Logger) Err(logText string)
- func (logger *Logger) Fatal(logText string)
- func (logger *Logger) Info(logText string)
- func (logger *Logger) IsUninitialized() bool
- func (logger *Logger) Panic(logText string)
- func (logger *Logger) SetContext(context string)
- func (logger *Logger) Shutdown()
- func (logger *Logger) Warning(logText string)
- type LoggingColor
- type LoggingConfig
- type LoggingFileAction
- type LoggingLevel
- type LoggingOutputMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is representative of the logger for use in other go programs
The following methods are exposed by this structure ( defined in golog.go ):
Debug(logText string): Log debug output to log destination Info(logText string): Log info output to log destination Warning(logText string): Log warning output to log destination Err(logText string): Log error output to log destination Fatal(logText string): Log fatal output to log destination Is_Uninitialized: Returns true if this structure has not been allocated
func SetupLoggerFromConfigFile ¶
func SetupLoggerFromConfigFile sets up and returns a logger instance as specified in 'fullFilePath' for 'profile'
func SetupLoggerFromFields ¶
func SetupLoggerFromFields(logMode LoggingOutputMode, logFileStartupAction LoggingFileAction, logDirectory string, logFile string, shouldColorize bool, isMock bool, isAsynch bool) (Logger, error)
func SetupLoggerFromFields sets up and returns a logger instance from passed in individual fields
func SetupLoggerFromStruct ¶
func SetupLoggerFromStruct(config *LoggingConfig) (Logger, error)
func SetupLoggerFromStruct sets up and returns a logger instance from a LoggingConfigStruct
func (*Logger) Fatal ¶
Fatal Outputs fatal information to the logging desination but does not cause a panic, use 'Panic' instead.
func (*Logger) IsUninitialized ¶
IsUninitialized Returns true if this structure has not yet been allocated since logging mode is private to golog, package users can never set 'logging mode' without using a logger setup method
func (*Logger) SetContext ¶
SetContext is called on the logger to the set its context. See 'Context' in the logging struct for more information
type LoggingColor ¶
type LoggingColor string
These are constants for terminal colors
func (LoggingColor) String ¶
func (color LoggingColor) String() string
type LoggingConfig ¶
type LoggingConfig struct { Name string // The logger profile name LogMode LoggingOutputMode // The logging mode LogFileStartupAction LoggingFileAction // The action the logger will take on startup LogDirectory string // The directory to which the logger writes LogFile string // The name of the log file to write to ShouldColorize bool // Indicates if we should output information in color IsMock bool // If true, mock the filesystem via 'afero' IsAsynch bool // If true, Asynchly handle log requests }
LoggingConfig holds a logging configuration for the logger and is used during logger initialization
type LoggingFileAction ¶
type LoggingFileAction int
const ( FileActionAppend LoggingFileAction = iota + 1 // Instructs the logger to append onto an existing log if one exists FileActionCompress // Instructs the logger to compress an existing log file if one exists FileActionDelete // Instructs the logger to remove an existing log file if one exits FileActionNone // Indicates no file actions ( e.g.: when user is writing to screen only ) )
func (LoggingFileAction) IsValidFileAction ¶
func (fileAction LoggingFileAction) IsValidFileAction() bool
type LoggingLevel ¶
type LoggingLevel string
Logging levels for the logger
func (LoggingLevel) String ¶
func (level LoggingLevel) String() string
type LoggingOutputMode ¶
type LoggingOutputMode int
const ( ModeFile LoggingOutputMode = iota + 1 // ModeFile indicates information will be outputted to a log file ModeScreen // ModeScreen indicates information will be outputted to the screen ModeBoth // ModeBoth indicates information will be outted to both file and screen )
func (LoggingOutputMode) Int ¶
func (mode LoggingOutputMode) Int() int
func (LoggingOutputMode) IsValidMode ¶
func (mode LoggingOutputMode) IsValidMode() bool
func (LoggingOutputMode) String ¶
func (mode LoggingOutputMode) String() string