log

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Buffalo

func Buffalo() buffalo.Logger

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.

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.
	// TODO(marwan-at-work): When we have our own Error struct
	// this method will be very useful.
	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.

type Logger

type Logger struct {
	*logrus.Logger
}

Logger is the main struct that any athens internal service should use to communicate things.

func New

func New(cloudProvider, level string) *Logger

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 (*Logger) SystemErr

func (l *Logger) SystemErr(err error)

SystemErr Entry implementation.

func (*Logger) WithFields

func (l *Logger) WithFields(fields map[string]interface{}) Entry

WithFields Entry implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL