Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Buffalo ¶
Buffalo returns a more sane logging format than the default buffalo formatter. For the most part, we only care about the path, the method, and the status code. It's also good to note that internal logs from buffalo should only be allowed in development as our logging-system should be handled from our codebase. If the environment is production, then its a noop logger.
func SetEntryInContext ¶ added in v0.2.0
SetEntryInContext stores an Entry in the buffalo context
Types ¶
type Entry ¶
type Entry interface {
// Basic Logging Operation
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
// Attach contextual information to the logging entry
WithFields(fields map[string]interface{}) Entry
// SystemErr is a method that disects the error
// and logs the appropriate level and fields for it.
SystemErr(err error)
}
Entry is an abstraction to the Logger and the logrus.Entry so that *Logger always creates an Entry copy which ensures no Fields are being overwritten.
func EntryFromContext ¶ added in v0.2.0
EntryFromContext returns an Entry that has been stored in the buffalo context. If there is no value for the key or the type assertion fails, it returns a new entry from the provided logger
type Logger ¶
Logger is the main struct that any athens internal service should use to communicate things.
func New ¶
New constructs a new logger based on the environment and the cloud platform it is running on. TODO: take cloud arg and env to construct the correct JSON formatter.
func NoOpLogger ¶ added in v0.2.0
func NoOpLogger() *Logger
NoOpLogger provides a Logger that does nothing
func (*Logger) WithFields ¶
WithFields Entry implementation.