Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Logger = logrus.New()
Logger is a global instance of logrus object.
Functions ¶
func LogCachedQuery ¶
func LogCachedQuery(method string)
LogCachedQuery logs a cache hit for a given method
func LogFailedQuery ¶
func LogFailedQuery(method string, query interface{}, error interface{})
LogFailedQuery takes a method name, query params, response error object and logs it
func LogSuccessfulQuery ¶
LogSuccessfulQuery takes a remote method name and execution time and logs it
func SetupLogging ¶
func SetupLogging()
SetupLogging initializes and sets a few parameters for the logging subsystem.
Types ¶
type F ¶
type F map[string]interface{}
F can be supplied to ModuleLogger's Log function for providing additional log context.
type ModuleLogger ¶
ModuleLogger contains module-specific logger details.
func NewModuleLogger ¶
func NewModuleLogger(moduleName string) ModuleLogger
NewModuleLogger creates a new ModuleLogger instance carrying module name for later `Log()` calls.
func (ModuleLogger) Log ¶
func (l ModuleLogger) Log() *logrus.Entry
Log returns a new log entry for the module which can be called upon with a corresponding logLevel. Example:
Log().Info("query error")