gosteno: github.com/cloudfoundry/gosteno Index | Files | Directories

package gosteno

import "github.com/cloudfoundry/gosteno"

Index

Package Files

codec.go config.go io_sink.go json_codec.go json_prettifier.go log_level.go logger.go record.go regexp.go sink.go steno.go syslog_sink.go testing_sink.go

Constants

const (
    EXCLUDE_NONE = 0

    EXCLUDE_LEVEL = 1 << (iota - 1)
    EXCLUDE_TIMESTAMP
    EXCLUDE_FILE
    EXCLUDE_LINE
    EXCLUDE_METHOD
    EXCLUDE_DATA
    EXCLUDE_MESSAGE
)
const (
    MaxMessageSize  = 1024 * 3
    TruncatePostfix = "..."
)

Variables

var (
    LOG_OFF    = defineLogLevel("off", 0)
    LOG_FATAL  = defineLogLevel("fatal", 1)
    LOG_ERROR  = defineLogLevel("error", 5)
    LOG_WARN   = defineLogLevel("warn", 10)
    LOG_INFO   = defineLogLevel("info", 15)
    LOG_DEBUG  = defineLogLevel("debug", 16)
    LOG_DEBUG1 = defineLogLevel("debug1", 17)
    LOG_DEBUG2 = defineLogLevel("debug2", 18)
    LOG_ALL    = defineLogLevel("all", 30)
)

func ClearLoggerRegexp Uses

func ClearLoggerRegexp()

func EnterTestMode Uses

func EnterTestMode(logLevel ...LogLevel)

func Init Uses

func Init(c *Config)

func SetLoggerRegexp Uses

func SetLoggerRegexp(pattern string, level LogLevel) error

type BaseLogger Uses

type BaseLogger struct {
    // contains filtered or unexported fields
}

func (*BaseLogger) Level Uses

func (l *BaseLogger) Level() LogLevel

func (*BaseLogger) Log Uses

func (l *BaseLogger) Log(x LogLevel, m string, d map[string]interface{})

type Codec Uses

type Codec interface {
    EncodeRecord(record *Record) ([]byte, error)
}

func NewJsonCodec Uses

func NewJsonCodec() Codec

type Config Uses

type Config struct {
    Sinks     []Sink
    Level     LogLevel
    Codec     Codec
    EnableLOC bool
}

type IOSink Uses

type IOSink struct {
    sync.Mutex
    // contains filtered or unexported fields
}

func NewFileSink Uses

func NewFileSink(path string) *IOSink

func NewIOSink Uses

func NewIOSink(file *os.File) *IOSink

func (*IOSink) AddRecord Uses

func (x *IOSink) AddRecord(record *Record)

func (*IOSink) Flush Uses

func (x *IOSink) Flush()

func (*IOSink) GetCodec Uses

func (x *IOSink) GetCodec() Codec

func (*IOSink) SetCodec Uses

func (x *IOSink) SetCodec(codec Codec)

type JsonCodec Uses

type JsonCodec struct {
}

func (*JsonCodec) EncodeRecord Uses

func (j *JsonCodec) EncodeRecord(record *Record) ([]byte, error)

type JsonPrettifier Uses

type JsonPrettifier struct {
    // contains filtered or unexported fields
}

func NewJsonPrettifier Uses

func NewJsonPrettifier(flag int) *JsonPrettifier

func (*JsonPrettifier) DecodeJsonLogEntry Uses

func (p *JsonPrettifier) DecodeJsonLogEntry(logEntry string) (*Record, error)

func (*JsonPrettifier) EncodeRecord Uses

func (p *JsonPrettifier) EncodeRecord(record *Record) ([]byte, error)

type L Uses

type L interface {
    Level() LogLevel
    Log(x LogLevel, m string, d map[string]interface{})
}

type LogLevel Uses

type LogLevel struct {
    Name     string
    Priority int
}

func GetLogLevel Uses

func GetLogLevel(name string) (LogLevel, error)

func (LogLevel) MarshalJSON Uses

func (x LogLevel) MarshalJSON() ([]byte, error)

func (LogLevel) String Uses

func (l LogLevel) String() string

func (*LogLevel) UnmarshalJSON Uses

func (x *LogLevel) UnmarshalJSON(data []byte) error

type Logger Uses

type Logger struct {
    sync.Mutex
    L
    // contains filtered or unexported fields
}

func NewLogger Uses

func NewLogger(name string) *Logger

func (*Logger) Copy Uses

func (l *Logger) Copy() (rv *Logger)

func (*Logger) Debug Uses

func (l *Logger) Debug(m string)

func (*Logger) Debug1 Uses

func (l *Logger) Debug1(m string)

func (*Logger) Debug1d Uses

func (l *Logger) Debug1d(d map[string]interface{}, m string)

func (*Logger) Debug1df Uses

func (l *Logger) Debug1df(d map[string]interface{}, f string, a ...interface{})

func (*Logger) Debug1f Uses

func (l *Logger) Debug1f(f string, a ...interface{})

func (*Logger) Debug2 Uses

func (l *Logger) Debug2(m string)

func (*Logger) Debug2d Uses

func (l *Logger) Debug2d(d map[string]interface{}, m string)

func (*Logger) Debug2df Uses

func (l *Logger) Debug2df(d map[string]interface{}, f string, a ...interface{})

func (*Logger) Debug2f Uses

func (l *Logger) Debug2f(f string, a ...interface{})

func (*Logger) Debugd Uses

func (l *Logger) Debugd(d map[string]interface{}, m string)

func (*Logger) Debugdf Uses

func (l *Logger) Debugdf(d map[string]interface{}, f string, a ...interface{})

func (*Logger) Debugf Uses

func (l *Logger) Debugf(f string, a ...interface{})

func (*Logger) Error Uses

func (l *Logger) Error(m string)

func (*Logger) Errord Uses

func (l *Logger) Errord(d map[string]interface{}, m string)

func (*Logger) Errordf Uses

func (l *Logger) Errordf(d map[string]interface{}, f string, a ...interface{})

func (*Logger) Errorf Uses

func (l *Logger) Errorf(f string, a ...interface{})

func (*Logger) Fatal Uses

func (l *Logger) Fatal(m string)

func (*Logger) Fatald Uses

func (l *Logger) Fatald(d map[string]interface{}, m string)

func (*Logger) Fataldf Uses

func (l *Logger) Fataldf(d map[string]interface{}, f string, a ...interface{})

func (*Logger) Fatalf Uses

func (l *Logger) Fatalf(f string, a ...interface{})

func (*Logger) Get Uses

func (l *Logger) Get(k string) (rv interface{})

func (*Logger) Info Uses

func (l *Logger) Info(m string)

func (*Logger) Infod Uses

func (l *Logger) Infod(d map[string]interface{}, m string)

func (*Logger) Infodf Uses

func (l *Logger) Infodf(d map[string]interface{}, f string, a ...interface{})

func (*Logger) Infof Uses

func (l *Logger) Infof(f string, a ...interface{})

func (*Logger) Log Uses

func (l *Logger) Log(x LogLevel, m string, d map[string]interface{})

func (*Logger) Set Uses

func (l *Logger) Set(k string, v interface{})

func (*Logger) Warn Uses

func (l *Logger) Warn(m string)

func (*Logger) Warnd Uses

func (l *Logger) Warnd(d map[string]interface{}, m string)

func (*Logger) Warndf Uses

func (l *Logger) Warndf(d map[string]interface{}, f string, a ...interface{})

func (*Logger) Warnf Uses

func (l *Logger) Warnf(f string, a ...interface{})

type Record Uses

type Record struct {
    Timestamp RecordTimestamp        `json:"timestamp"`
    Pid       int                    `json:"process_id"`
    Source    string                 `json:"source"`
    Level     LogLevel               `json:"log_level"`
    Message   string                 `json:"message"`
    Data      map[string]interface{} `json:"data"`
    File      string                 `json:"file,omitempty"`
    Line      int                    `json:"line,omitempty"`
    Method    string                 `json:"method,omitempty"`
}

func NewRecord Uses

func NewRecord(s string, l LogLevel, m string, d map[string]interface{}) *Record

type RecordTimestamp Uses

type RecordTimestamp float64

func (RecordTimestamp) MarshalJSON Uses

func (t RecordTimestamp) MarshalJSON() ([]byte, error)

type Sink Uses

type Sink interface {
    AddRecord(record *Record)
    Flush()

    SetCodec(codec Codec)
    GetCodec() Codec
}

type Syslog Uses

type Syslog struct {
    sync.Mutex
    // contains filtered or unexported fields
}

func NewSyslogSink Uses

func NewSyslogSink(namespace string) *Syslog

func (*Syslog) AddRecord Uses

func (s *Syslog) AddRecord(record *Record)

func (*Syslog) Flush Uses

func (s *Syslog) Flush()

func (*Syslog) GetCodec Uses

func (s *Syslog) GetCodec() Codec

func (*Syslog) SetCodec Uses

func (s *Syslog) SetCodec(codec Codec)

type TestingSink Uses

type TestingSink struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

func GetMeTheGlobalTestSink Uses

func GetMeTheGlobalTestSink() *TestingSink

func NewTestingSink Uses

func NewTestingSink() *TestingSink

func (*TestingSink) AddRecord Uses

func (tSink *TestingSink) AddRecord(record *Record)

func (*TestingSink) Flush Uses

func (tSink *TestingSink) Flush()

func (*TestingSink) GetCodec Uses

func (tSink *TestingSink) GetCodec() Codec

func (*TestingSink) Records Uses

func (tSink *TestingSink) Records() []*Record

func (*TestingSink) SetCodec Uses

func (tSink *TestingSink) SetCodec(codec Codec)

Directories

PathSynopsis
gosteno-prettify
syslogPackage syslog provides a simple interface to the system log service.

Package gosteno imports 14 packages (graph) and is imported by 289 packages. Updated 2016-11-10. Refresh now. Tools for package owners.