log

package
v0.0.0-...-d8e89f0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DS is the location of the log dS file
	DS = "core" + string(os.PathSeparator) + "log.ds"
	// AuthType is the log type for authentication log entries
	AuthType = "authentication"
	// Four04Type is the log type for 404 errors
	Four04Type = "404"
)

Variables

This section is empty.

Functions

func Error

func Error(err error)

Error logs and error to the core log datastore. For core code the rule for error logging is to not log it until it's "bubbled up to the top". Meaning only the http handler should log the error. This is to prevent the same error from being logged a bunch of times.

func FHLogger

func FHLogger() *log.Logger

FHLogger returns a logger for use with the http server

func Fail

func Fail(err *fail.Fail, who string)

Fail logs a failure in the datastore

func NewEntry

func NewEntry(Type string, entry string)

NewEntry inserts a new log entry into the datastore

func SyslogError

func SyslogError(err error)

SyslogError logs the error to the system log, UNIX only

Types

type Iter

type Iter struct {
	Type  string           `json:"type,omitempty"`
	From  *json.RawMessage `json:"from,omitempty"`
	To    *json.RawMessage `json:"to,omitempty"`
	Skip  int              `json:"skip,omitempty"`
	Limit int              `json:"limit,omitempty"`
	Order string           `json:"order,omitempty"`
}

Iter is an iterator for log entries

type Log

type Log struct {
	When string `json:"when"`
	Type string `json:"type"`
	Log  string `json:"log"`
}

Log is the storage stucture for a log entry

func Get

func Get(iter *Iter) ([]*Log, error)

Get retrieves a list of logs from the datastore

Jump to

Keyboard shortcuts

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