thriftlion

package
v0.0.0-...-304b2f4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package thriftlion defines the Thrift functionality for lion.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Encoding is the name of the encoding.
	Encoding = "thrift-binary"
)
View Source
var EntryMessage_Encoding_DEFAULT string
View Source
var EntryMessage_Name_DEFAULT string
View Source
var EntryMessage_Value_DEFAULT []byte
View Source
var Entry_Context_DEFAULT []*EntryMessage
View Source
var Entry_Fields_DEFAULT map[string]string
View Source
var Entry_ID_DEFAULT string
View Source
var Entry_Message_DEFAULT string
View Source
var Entry_TimeUnixNanos_DEFAULT int64
View Source
var Entry_WriterOutput_DEFAULT []byte
View Source
var GoUnusedProtection__ int

Functions

func Debug

func Debug(event thrift.TStruct)

Debug calls Debug on the global Logger.

func DebugWriter

func DebugWriter() io.Writer

DebugWriter calls DebugWriter on the global Logger.

func Debugf

func Debugf(format string, args ...interface{})

Debugf calls Debugf on the global Logger.

func Debugln

func Debugln(args ...interface{})

Debugln calls Debugln on the global Logger.

func Error

func Error(event thrift.TStruct)

Error calls Error on the global Logger.

func ErrorWriter

func ErrorWriter() io.Writer

ErrorWriter calls ErrorWriter on the global Logger.

func Errorf

func Errorf(format string, args ...interface{})

Errorf calls Errorf on the global Logger.

func Errorln

func Errorln(args ...interface{})

Errorln calls Errorln on the global Logger.

func Fatal

func Fatal(event thrift.TStruct)

Fatal calls Fatal on the global Logger.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf calls Fatalf on the global Logger.

func Fatalln

func Fatalln(args ...interface{})

Fatalln calls Fatalln on the global Logger.

func Flush

func Flush() error

Flush calls Flush on the global Logger.

func Info

func Info(event thrift.TStruct)

Info calls Info on the global Logger.

func InfoWriter

func InfoWriter() io.Writer

InfoWriter calls InfoWriter on the global Logger.

func Infof

func Infof(format string, args ...interface{})

Infof calls Infof on the global Logger.

func Infoln

func Infoln(args ...interface{})

Infoln calls Infoln on the global Logger.

func LionLogger

func LionLogger() lion.Logger

LionLogger calls LionLogger on the global Logger.

func MustRegister

func MustRegister(constructor interface{})

MustRegister calls Register and panics on error.

func Panic

func Panic(event thrift.TStruct)

Panic calls Panic on the global Logger.

func Panicf

func Panicf(format string, args ...interface{})

Panicf calls Panicf on the global Logger.

func Panicln

func Panicln(args ...interface{})

Panicln calls Panicln on the global Logger.

func Print

func Print(event thrift.TStruct)

Print calls Print on the global Logger.

func Printf

func Printf(format string, args ...interface{})

Printf calls Printf on the global Logger.

func Println

func Println(args ...interface{})

Println calls Println on the global Logger.

func Register

func Register(constructor interface{}) error

Register registers the given thrift.TStruct using the generated constructor.

The given constructor must be of the correct type.

func Warn

func Warn(event thrift.TStruct)

Warn calls Warn on the global Logger.

func WarnWriter

func WarnWriter() io.Writer

WarnWriter calls WarnWriter on the global Logger.

func Warnf

func Warnf(format string, args ...interface{})

Warnf calls Warnf on the global Logger.

func Warnln

func Warnln(args ...interface{})

Warnln calls Warnln on the global Logger.

func Writer

func Writer() io.Writer

Writer calls Writer on the global Logger.

Types

type Entry

type Entry struct {
	ID            *string           `thrift:"id,1" db:"id" json:"id,omitempty"`
	Level         *Level            `thrift:"level,2" db:"level" json:"level,omitempty"`
	TimeUnixNanos *int64            `thrift:"time_unix_nanos,3" db:"time_unix_nanos" json:"time_unix_nanos,omitempty"`
	Context       []*EntryMessage   `thrift:"context,4" db:"context" json:"context,omitempty"`
	Fields        map[string]string `thrift:"fields,5" db:"fields" json:"fields,omitempty"`
	Event         *EntryMessage     `thrift:"event,6" db:"event" json:"event,omitempty"`
	Message       *string           `thrift:"message,7" db:"message" json:"message,omitempty"`
	WriterOutput  []byte            `thrift:"writer_output,8" db:"writer_output" json:"writer_output,omitempty"`
}

Attributes:

  • ID
  • Level
  • TimeUnixNanos
  • Context
  • Fields
  • Event
  • Message
  • WriterOutput

func NewEntry

func NewEntry() *Entry

func (*Entry) GetContext

func (p *Entry) GetContext() []*EntryMessage

func (*Entry) GetEvent

func (p *Entry) GetEvent() *EntryMessage

func (*Entry) GetFields

func (p *Entry) GetFields() map[string]string

func (*Entry) GetID

func (p *Entry) GetID() string

func (*Entry) GetLevel

func (p *Entry) GetLevel() Level

func (*Entry) GetMessage

func (p *Entry) GetMessage() string

func (*Entry) GetTimeUnixNanos

func (p *Entry) GetTimeUnixNanos() int64

func (*Entry) GetWriterOutput

func (p *Entry) GetWriterOutput() []byte

func (*Entry) IsSetContext

func (p *Entry) IsSetContext() bool

func (*Entry) IsSetEvent

func (p *Entry) IsSetEvent() bool

func (*Entry) IsSetFields

func (p *Entry) IsSetFields() bool

func (*Entry) IsSetID

func (p *Entry) IsSetID() bool

func (*Entry) IsSetLevel

func (p *Entry) IsSetLevel() bool

func (*Entry) IsSetMessage

func (p *Entry) IsSetMessage() bool

func (*Entry) IsSetTimeUnixNanos

func (p *Entry) IsSetTimeUnixNanos() bool

func (*Entry) IsSetWriterOutput

func (p *Entry) IsSetWriterOutput() bool

func (*Entry) Read

func (p *Entry) Read(iprot thrift.TProtocol) error

func (*Entry) ReadField1

func (p *Entry) ReadField1(iprot thrift.TProtocol) error

func (*Entry) ReadField2

func (p *Entry) ReadField2(iprot thrift.TProtocol) error

func (*Entry) ReadField3

func (p *Entry) ReadField3(iprot thrift.TProtocol) error

func (*Entry) ReadField4

func (p *Entry) ReadField4(iprot thrift.TProtocol) error

func (*Entry) ReadField5

func (p *Entry) ReadField5(iprot thrift.TProtocol) error

func (*Entry) ReadField6

func (p *Entry) ReadField6(iprot thrift.TProtocol) error

func (*Entry) ReadField7

func (p *Entry) ReadField7(iprot thrift.TProtocol) error

func (*Entry) ReadField8

func (p *Entry) ReadField8(iprot thrift.TProtocol) error

func (*Entry) String

func (p *Entry) String() string

func (*Entry) Write

func (p *Entry) Write(oprot thrift.TProtocol) error

type EntryMessage

type EntryMessage struct {
	Encoding *string `thrift:"encoding,1" db:"encoding" json:"encoding,omitempty"`
	Name     *string `thrift:"name,2" db:"name" json:"name,omitempty"`
	Value    []byte  `thrift:"value,3" db:"value" json:"value,omitempty"`
}

Attributes:

  • Encoding
  • Name
  • Value
var Entry_Event_DEFAULT *EntryMessage

func NewEntryMessage

func NewEntryMessage() *EntryMessage

func (*EntryMessage) GetEncoding

func (p *EntryMessage) GetEncoding() string

func (*EntryMessage) GetName

func (p *EntryMessage) GetName() string

func (*EntryMessage) GetValue

func (p *EntryMessage) GetValue() []byte

func (*EntryMessage) IsSetEncoding

func (p *EntryMessage) IsSetEncoding() bool

func (*EntryMessage) IsSetName

func (p *EntryMessage) IsSetName() bool

func (*EntryMessage) IsSetValue

func (p *EntryMessage) IsSetValue() bool

func (*EntryMessage) Read

func (p *EntryMessage) Read(iprot thrift.TProtocol) error

func (*EntryMessage) ReadField1

func (p *EntryMessage) ReadField1(iprot thrift.TProtocol) error

func (*EntryMessage) ReadField2

func (p *EntryMessage) ReadField2(iprot thrift.TProtocol) error

func (*EntryMessage) ReadField3

func (p *EntryMessage) ReadField3(iprot thrift.TProtocol) error

func (*EntryMessage) String

func (p *EntryMessage) String() string

func (*EntryMessage) Write

func (p *EntryMessage) Write(oprot thrift.TProtocol) error

type Level

type Level int64
const (
	Level_DEBUG Level = 0
	Level_INFO  Level = 1
	Level_WARN  Level = 2
	Level_ERROR Level = 3
	Level_FATAL Level = 4
	Level_PANIC Level = 5
	Level_NONE  Level = 6
)
var Entry_Level_DEFAULT Level

func LevelFromString

func LevelFromString(s string) (Level, error)

func LevelPtr

func LevelPtr(v Level) *Level

func (Level) MarshalText

func (p Level) MarshalText() ([]byte, error)

func (*Level) Scan

func (p *Level) Scan(value interface{}) error

func (Level) String

func (p Level) String() string

func (*Level) UnmarshalText

func (p *Level) UnmarshalText(text []byte) error

func (*Level) Value

func (p *Level) Value() (driver.Value, error)

type LevelLogger

type LevelLogger interface {
	lion.BaseLevelLogger

	WithField(key string, value interface{}) LevelLogger
	WithFields(fields map[string]interface{}) LevelLogger
	WithKeyValues(keyvalues ...interface{}) LevelLogger
	WithContext(context thrift.TStruct) LevelLogger

	Print(event thrift.TStruct)
}

LevelLogger is a lion.LevelLogger that also has proto logging methods.

func LogDebug

func LogDebug() LevelLogger

LogDebug calls LogDebug on the global Logger.

func LogInfo

func LogInfo() LevelLogger

LogInfo calls LogInfo on the global Logger.

type Logger

type Logger interface {
	lion.BaseLogger

	AtLevel(level lion.Level) Logger
	WithField(key string, value interface{}) Logger
	WithFields(fields map[string]interface{}) Logger
	WithKeyValues(keyValues ...interface{}) Logger

	WithContext(context thrift.TStruct) Logger
	Debug(event thrift.TStruct)
	Info(event thrift.TStruct)
	Warn(event thrift.TStruct)
	Error(event thrift.TStruct)
	Fatal(event thrift.TStruct)
	Panic(event thrift.TStruct)
	Print(event thrift.TStruct)

	// NOTE: this function name may change, this is experimental
	LogDebug() LevelLogger
	// NOTE: this function name may change, this is experimental
	LogInfo() LevelLogger

	LionLogger() lion.Logger
}

Logger is a lion.Logger that also has proto logging methods.

func AtLevel

func AtLevel(level lion.Level) Logger

AtLevel calls AtLevel on the global Logger.

func GlobalLogger

func GlobalLogger() Logger

GlobalLogger returns the global Logger instance.

func NewLogger

func NewLogger(delegate lion.Logger) Logger

NewLogger returns a new Logger.

func WithContext

func WithContext(context thrift.TStruct) Logger

WithContext calls WithContext on the global Logger.

func WithField

func WithField(key string, value interface{}) Logger

WithField calls WithField on the global Logger.

func WithFields

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

WithFields calls WithFields on the global Logger.

func WithKeyValues

func WithKeyValues(keyValues ...interface{}) Logger

WithKeyValues calls WithKeyValues on the global Logger.

Directories

Path Synopsis
Package thriftliontesting defines testing for thriftlion.
Package thriftliontesting defines testing for thriftlion.

Jump to

Keyboard shortcuts

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