espipe: Index | Files

package log

import ""


Package Files

client.go level.go logger.go message.go

type Config Uses

type Config struct {
    Source string
    // contains filtered or unexported fields

Config -

type Level Uses

type Level string

Level defines the severity of the log message

const (
    // LevelVerbose defines the "Verbose" log level/severity
    LevelVerbose Level = "Verbose"
    // LevelInfo defines the "Information" log level/severity
    LevelInfo Level = "Information"
    // LevelWarning defines the "Warning" log level/severity
    LevelWarning Level = "Warning"
    // LevelError defines the "Error" log level/severity
    LevelError Level = "Error"
    // LevelFatal defines the "Fatal" log level/severity
    LevelFatal Level = "Fatal"

type Logger Uses

type Logger interface {
    Message(lvl Level, rid, msg string)
    WebCall(rid, cip, host, path, method, reqBody string, statCode int, resBody string, sec float64)

Logger defines the Peaks services generic logging interface

func NewLogger Uses

func NewLogger(config Config) Logger

NewLogger creates new espipe logger

type Message Uses

type Message struct {
    Level     Level  `json:"level"`
    Source    string `json:"source"`
    RequestID string `json:"request_id"`
    Message   string `json:"message"`

Message is a basic representation of a log

type WebCall Uses

type WebCall struct {
    Level             Level   `json:"level"`
    Source            string  `json:"source"`
    RequestID         string  `json:"request_id"`
    ClientIP          string  `json:"client_ip"`
    Host              string  `json:"host"`
    Path              string  `json:"path"`
    Method            string  `json:"method"`
    Request           string  `json:"request"`
    StatusCode        int     `json:"status_code"`
    Response          string  `json:"response"`
    ResponseInSeconds float64 `json:"response_in_seconds"`

WebCall is http call trace ready to be logged

Package log imports 6 packages (graph). Updated 2018-11-17. Refresh now. Tools for package owners.