Documentation ¶
Index ¶
- func DatabaseConfiguration() *sql.DB
- func NewSysLogger(prio syslog.Priority, flag int) (*log.Logger, error)
- type CompositeLog
- func (composite *CompositeLog) Debug(v ...interface{})
- func (composite *CompositeLog) Debugf(format string, v ...interface{})
- func (composite *CompositeLog) Error(v ...interface{})
- func (composite *CompositeLog) Errorf(format string, v ...interface{})
- func (composite *CompositeLog) Info(v ...interface{})
- func (composite *CompositeLog) Infof(format string, v ...interface{})
- func (composite *CompositeLog) Warn(v ...interface{})
- func (composite *CompositeLog) Warnf(format string, v ...interface{})
- type DBLogger
- type FileLogger
- type StdLogger
- type SuperLogger
- type SysLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseConfiguration ¶
DatabaseConfiguration - sets up the DB connection
Types ¶
type CompositeLog ¶
type CompositeLog struct {
// contains filtered or unexported fields
}
CompositeLog structure was needed to implement the "true for debug, false for no debug" functionality.
func NewCustomLogger ¶
func NewCustomLogger(flag bool, args ...SuperLogger) *CompositeLog
NewCustomLogger adds all passed loggers into a slice of SuperLoggers (Variadic args...SuperLogger) We see here that we can add more loggers (we just need to pass them through)
func (*CompositeLog) Debug ¶
func (composite *CompositeLog) Debug(v ...interface{})
Debug (skipped if flag == false)
func (*CompositeLog) Debugf ¶
func (composite *CompositeLog) Debugf(format string, v ...interface{})
Debugf (skipped if flag == false)
func (*CompositeLog) Errorf ¶
func (composite *CompositeLog) Errorf(format string, v ...interface{})
Errorf ..
func (*CompositeLog) Infof ¶
func (composite *CompositeLog) Infof(format string, v ...interface{})
Infof ..
func (*CompositeLog) Warnf ¶
func (composite *CompositeLog) Warnf(format string, v ...interface{})
Warnf ..
type DBLogger ¶
type DBLogger struct {
// contains filtered or unexported fields
}
DBLogger subclass
func NewDBLogger ¶
NewDBLogger routes the DB connection from "DatabaseConfiguration" to the DB logger, then creates it.
func (*DBLogger) Printf ¶
Printf (for DB) converts the printed output to string, then passes it for database recording
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
FileLogger subclass
func NewFileLogger ¶
func NewFileLogger(path string) *FileLogger
NewFileLogger creates a new file logger (attaches the opened/created file found at "path" to the file loggers' file descriptor)
func (*FileLogger) Printf ¶
func (flogger *FileLogger) Printf(format string, v ...interface{})
Printf directly uses the file descriptors' Write()
func (*FileLogger) Println ¶
func (flogger *FileLogger) Println(v ...interface{})
Println directly uses the file descriptors' Write()
func (*FileLogger) SetPrefix ¶
func (flogger *FileLogger) SetPrefix(s string)
SetPrefix sets the prefix of the logger
type StdLogger ¶
type StdLogger struct {
// contains filtered or unexported fields
}
StdLogger subclass
func NewStdLogger ¶
func NewStdLogger() *StdLogger
NewStdLogger creates a new stdout logger (StdLogger) by attaching the opened /dev/stdout to the file descriptor.
type SuperLogger ¶
type SuperLogger interface { Println(v ...interface{}) Printf(format string, v ...interface{}) SetPrefix(s string) }
SuperLogger superclass
type SysLogger ¶
type SysLogger struct {
// contains filtered or unexported fields
}
SysLogger subclass