Documentation ¶
Overview ¶
Package log provides logging support for the application and framework developers
Index ¶
- Constants
- Variables
- func CreateDefaultLoggers()
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func FrameworkDebug(v ...interface{})
- func FrameworkDebugf(format string, v ...interface{})
- func HasLogger(id int) bool
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Print(logType int, v ...interface{})
- func Printf(logType int, format string, v ...interface{})
- func SetLogger(id int, l LoggerI)
- func Sql(v ...interface{})
- func StackTrace(startingDepth int, maxDepth int) (out string)
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type EmailLogger
- type LoggerI
- type StandardLogger
Constants ¶
const DebugLog = 10 // Debug log for the developer's application, separate from the goradd framework debug log
const ErrorLog = 4 // Should be sent to sysop immediately
const FrameworkDebugLog = 1 // Should only exist when debugging style logs are required for debugging the goradd framework itself.
const InfoLog = 2 // Info log is designed to always exist. These would be messages we only need to check periodically to know the system is working correctly.
const SqlLog = 5 // For watching SQL statements as they are sent to the database driver
const WarningLog = 3 // Should be sent to sysop periodically (daily perhaps?). Would generally be issues involving low resources.
Variables ¶
var Loggers = map[int]LoggerI{}
Loggers is the global map of loggers in use.
Functions ¶
func CreateDefaultLoggers ¶
func CreateDefaultLoggers()
CreateDefaultLoggers create's default loggers for the application. After calling this, you can replace the loggers with your own, and add additional loggers to the logging array, or remove ones you don't use.
func Debug ¶
func Debug(v ...interface{})
Debug is for application debugging logging. It becomes a no-op in the release build.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf prints formatted information to the application Debug logger. It becomes a no-op in the release build.
func Errorf ¶
func Errorf(format string, v ...interface{})
Error prints formmated information to the Error logger.
func FrameworkDebug ¶
func FrameworkDebug(v ...interface{})
FrameworkDebug is used by the framework to log debugging information. This is mostly for development of the framework, but it can also be used to track down problems in your own code. It becomes a no-op in the release build.
func FrameworkDebugf ¶
func FrameworkDebugf(format string, v ...interface{})
FrameworkDebugf is used by the framework to log formatted debugging information. It becomes a no-op in the release build.
func Infof ¶
func Infof(format string, v ...interface{})
Infof prints formatted information to the Info logger.
func Print ¶
func Print(logType int, v ...interface{})
Print prints information to the given logger. You can use this to set up your own custom logger.
func Sql ¶ added in v0.25.0
func Sql(v ...interface{})
Sql outputs the sql sent to the database driver.
func StackTrace ¶ added in v0.19.0
StackTrace returns a formatted stack trace, listing files and functions on each line.
Types ¶
type EmailLogger ¶
type EmailLogger struct { StandardLogger EmailAddresses []string }
EmailLogger is a logger that will email logging activity to the emails provided.
func (EmailLogger) Log ¶
func (l EmailLogger) Log(out string)
type StandardLogger ¶
StandardLogger reuses the GO default logger
func (StandardLogger) Log ¶
func (l StandardLogger) Log(out string)