Documentation ¶
Index ¶
- Constants
- func Any(v interface{}) anyV
- func Bool(v bool) boolV
- func Boolp(p *bool) boolP
- func Bytes(v []byte) bytesV
- func Bytesp(p *[]byte) bytesP
- func Complex128(v complex128) complex128V
- func Complex128p(p *complex128) complex128P
- func Complex64(v complex64) complex64V
- func Complex64p(p *complex64) complex64P
- func Duration(v time.Duration) durationV
- func Durationp(p *time.Duration) durationP
- func Error(v error) errorV
- func Float32(v float32) float32V
- func Float32p(p *float32) float32P
- func Float64(v float64) float64V
- func Float64p(p *float64) float64P
- func Func(v func() KV) funcV
- func Int(v int) intV
- func Int16(v int16) int16V
- func Int16p(p *int16) int16P
- func Int32(v int32) int32V
- func Int32p(p *int32) int32P
- func Int64(v int64) int64V
- func Int64p(p *int64) int64P
- func Int8(v int8) int8V
- func Int8p(p *int8) int8P
- func Intp(p *int) intP
- func Raw(v []byte) rawV
- func Reflect(v interface{}) reflectV
- func Runes(v []rune) runesV
- func Runesp(p *[]rune) runesP
- func String(v string) stringV
- func StringAny(k string, v interface{}) kvp
- func StringBool(k string, v bool) kvp
- func StringBoolp(k string, v *bool) kvp
- func StringBytes(k string, v []byte) kvp
- func StringBytesp(k string, v *[]byte) kvp
- func StringComplex128(k string, v complex128) kvp
- func StringComplex128p(k string, v *complex128) kvp
- func StringComplex64(k string, v complex64) kvp
- func StringComplex64p(k string, v *complex64) kvp
- func StringDuration(k string, v time.Duration) kvp
- func StringDurationp(k string, v *time.Duration) kvp
- func StringError(k string, v error) kvp
- func StringFloat32(k string, v float32) kvp
- func StringFloat32p(k string, v *float32) kvp
- func StringFloat64(k string, v float64) kvp
- func StringFloat64p(k string, v *float64) kvp
- func StringFunc(k string, v func() KV) kvp
- func StringInt(k string, v int) kvp
- func StringInt16(k string, v int16) kvp
- func StringInt16p(k string, v *int16) kvp
- func StringInt32(k string, v int32) kvp
- func StringInt32p(k string, v *int32) kvp
- func StringInt64(k string, v int64) kvp
- func StringInt64p(k string, v *int64) kvp
- func StringInt8(k string, v int8) kvp
- func StringInt8p(k string, v *int8) kvp
- func StringIntp(k string, v *int) kvp
- func StringRaw(k string, v []byte) kvp
- func StringReflect(k string, v interface{}) kvp
- func StringRunes(k string, v []rune) kvp
- func StringRunesp(k string, v *[]rune) kvp
- func StringStringp(k string, v *string) kvp
- func StringTime(k string, v time.Time) kvp
- func StringTimep(k string, v *time.Time) kvp
- func StringUint(k string, v uint) kvp
- func StringUint16(k string, v uint16) kvp
- func StringUint16p(k string, v *uint16) kvp
- func StringUint32(k string, v uint32) kvp
- func StringUint32p(k string, v *uint32) kvp
- func StringUint64(k string, v uint64) kvp
- func StringUint64p(k string, v *uint64) kvp
- func StringUint8(k string, v uint8) kvp
- func StringUint8p(k string, v *uint8) kvp
- func StringUintp(k string, v *uint) kvp
- func StringUintptr(k string, v uintptr) kvp
- func StringUintptrp(k string, v *uintptr) kvp
- func Stringp(p *string) stringP
- func Strings(a ...string) kvp
- func Text(v encoding.TextMarshaler) textV
- func TextAny(k encoding.TextMarshaler, v interface{}) kvp
- func TextBool(k encoding.TextMarshaler, v bool) kvp
- func TextBoolp(k encoding.TextMarshaler, v *bool) kvp
- func TextBytes(k encoding.TextMarshaler, v []byte) kvp
- func TextBytesp(k encoding.TextMarshaler, v *[]byte) kvp
- func TextComplex128(k encoding.TextMarshaler, v complex128) kvp
- func TextComplex128p(k encoding.TextMarshaler, v *complex128) kvp
- func TextComplex64(k encoding.TextMarshaler, v complex64) kvp
- func TextComplex64p(k encoding.TextMarshaler, v *complex64) kvp
- func TextDuration(k encoding.TextMarshaler, v time.Duration) kvp
- func TextDurationp(k encoding.TextMarshaler, v *time.Duration) kvp
- func TextError(k encoding.TextMarshaler, v error) kvp
- func TextFloat32(k encoding.TextMarshaler, v float32) kvp
- func TextFloat32p(k encoding.TextMarshaler, v *float32) kvp
- func TextFloat64(k encoding.TextMarshaler, v float64) kvp
- func TextFloat64p(k encoding.TextMarshaler, v *float64) kvp
- func TextFunc(k encoding.TextMarshaler, v func() json.Marshaler) kvp
- func TextInt(k encoding.TextMarshaler, v int) kvp
- func TextInt16(k encoding.TextMarshaler, v int16) kvp
- func TextInt16p(k encoding.TextMarshaler, v *int16) kvp
- func TextInt32(k encoding.TextMarshaler, v int32) kvp
- func TextInt32p(k encoding.TextMarshaler, v *int32) kvp
- func TextInt64(k encoding.TextMarshaler, v int64) kvp
- func TextInt64p(k encoding.TextMarshaler, v *int64) kvp
- func TextInt8(k encoding.TextMarshaler, v int8) kvp
- func TextInt8p(k encoding.TextMarshaler, v *int8) kvp
- func TextIntp(k encoding.TextMarshaler, v *int) kvp
- func TextRaw(k encoding.TextMarshaler, v []byte) kvp
- func TextReflect(k encoding.TextMarshaler, v interface{}) kvp
- func TextRunes(k encoding.TextMarshaler, v []rune) kvp
- func TextRunesp(k encoding.TextMarshaler, v *[]rune) kvp
- func TextString(k encoding.TextMarshaler, v string) kvp
- func TextStringp(k encoding.TextMarshaler, v *string) kvp
- func TextTime(k encoding.TextMarshaler, v time.Time) kvp
- func TextTimep(k encoding.TextMarshaler, v *time.Time) kvp
- func TextUint(k encoding.TextMarshaler, v uint) kvp
- func TextUint16(k encoding.TextMarshaler, v uint16) kvp
- func TextUint16p(k encoding.TextMarshaler, v *uint16) kvp
- func TextUint32(k encoding.TextMarshaler, v uint32) kvp
- func TextUint32p(k encoding.TextMarshaler, v *uint32) kvp
- func TextUint64(k encoding.TextMarshaler, v uint64) kvp
- func TextUint64p(k encoding.TextMarshaler, v *uint64) kvp
- func TextUint8(k encoding.TextMarshaler, v uint8) kvp
- func TextUint8p(k encoding.TextMarshaler, v *uint8) kvp
- func TextUintp(k encoding.TextMarshaler, v *uint) kvp
- func TextUintptr(k encoding.TextMarshaler, v uintptr) kvp
- func TextUintptrp(k encoding.TextMarshaler, v *uintptr) kvp
- func Texts(a ...encoding.TextMarshaler) kvp
- func Time(v time.Time) timeV
- func Timep(p *time.Time) timeP
- func Uint(v uint) uintV
- func Uint16(v uint16) uint16V
- func Uint16p(p *uint16) uint16P
- func Uint32(v uint32) uint32V
- func Uint32p(p *uint32) uint32P
- func Uint64(v uint64) uint64V
- func Uint64p(p *uint64) uint64P
- func Uint8(v uint8) uint8V
- func Uint8p(p *uint8) uint8P
- func Uintp(p *uint) uintP
- func Uintptr(v uintptr) uintptrV
- func Uintptrp(p *uintptr) uintptrP
- type KV
- type Log
- type Logger
Constants ¶
const ( Original = iota Excerpt Trail File )
const ( Trunc = iota Blank )
Variables ¶
This section is empty.
Functions ¶
func Bool ¶ added in v0.105.0
func Bool(v bool) boolV
Bool returns stringer/JSON marshaler interface implementation for the bool type.
func Boolp ¶ added in v0.105.0
func Boolp(p *bool) boolP
Bool returns stringer/JSON marshaler interface implementation for the pointer to the bool type.
func Bytes ¶ added in v0.105.0
func Bytes(v []byte) bytesV
Bytes returns stringer/JSON marshaler interface implementation for the byte slice type.
func Bytesp ¶ added in v0.105.0
func Bytesp(p *[]byte) bytesP
Bytesp returns stringer/JSON marshaler interface implementation for the pointer to the byte slice type.
func Complex128 ¶ added in v0.105.0
func Complex128(v complex128) complex128V
Complex128 returns stringer/JSON marshaler interface implementation for the complex128 type.
func Complex128p ¶ added in v0.105.0
func Complex128p(p *complex128) complex128P
Complex128p returns stringer/JSON marshaler interface implementation for the pointer to the complex128 type.
func Complex64 ¶ added in v0.105.0
func Complex64(v complex64) complex64V
Complex64 returns stringer/JSON marshaler interface implementation for the complex64 type.
func Complex64p ¶ added in v0.105.0
func Complex64p(p *complex64) complex64P
Complex64p returns stringer/JSON marshaler interface implementation for the pointer to the complex64 type.
func Duration ¶ added in v0.105.0
Duration returns stringer/JSON marshaler interface implementation for the time duration type.
func Durationp ¶ added in v0.105.0
Durationp returns stringer/JSON marshaler interface implementation for the pointer to the time duration type.
func Error ¶ added in v0.105.0
func Error(v error) errorV
Error returns stringer/JSON marshaler interface implementation for the error type.
func Float32 ¶ added in v0.105.0
func Float32(v float32) float32V
Float32 returns stringer/JSON marshaler interface implementation for the float32 type.
func Float32p ¶ added in v0.105.0
func Float32p(p *float32) float32P
Float32p returns stringer/JSON marshaler interface implementation for the pointer to the float32 type.
func Float64 ¶ added in v0.105.0
func Float64(v float64) float64V
Float64 returns stringer/JSON marshaler interface implementation for the float64 type.
func Float64p ¶ added in v0.105.0
func Float64p(p *float64) float64P
Float64p returns stringer/JSON marshaler interface implementation for the pointer to the float64 type.
func Func ¶ added in v0.105.0
func Func(v func() KV) funcV
Func returns stringer/JSON marshaler interface implementation for the custom func type.
func Int ¶ added in v0.105.0
func Int(v int) intV
Int returns stringer/JSON marshaler interface implementation for the int type.
func Int16 ¶ added in v0.105.0
func Int16(v int16) int16V
Int16 returns stringer/JSON marshaler interface implementation for the int16 type.
func Int16p ¶ added in v0.105.0
func Int16p(p *int16) int16P
Int16p returns stringer/JSON marshaler interface implementation for the pointer to the int16 type.
func Int32 ¶ added in v0.105.0
func Int32(v int32) int32V
Int32 returns stringer/JSON marshaler interface implementation for the int32 type.
func Int32p ¶ added in v0.105.0
func Int32p(p *int32) int32P
Int32p returns stringer/JSON marshaler interface implementation for the pointer to the int32 type.
func Int64 ¶ added in v0.105.0
func Int64(v int64) int64V
Int64 returns stringer/JSON marshaler interface implementation for the int64 type.
func Int64p ¶ added in v0.105.0
func Int64p(p *int64) int64P
Int64p returns stringer/JSON marshaler interface implementation for the pointer to the int64 type.
func Int8 ¶ added in v0.105.0
func Int8(v int8) int8V
Int8 returns stringer/JSON marshaler interface implementation for the int8 type.
func Int8p ¶ added in v0.105.0
func Int8p(p *int8) int8P
Int8p returns stringer/JSON marshaler interface implementation for the pointer to the int8 type.
func Intp ¶ added in v0.105.0
func Intp(p *int) intP
Intp returns stringer/JSON marshaler interface implementation for the pointer to the int type.
func Raw ¶ added in v0.105.0
func Raw(v []byte) rawV
Raw returns stringer/JSON marshaler interface implementation for the raw byte slice.
func Runes ¶ added in v0.105.0
func Runes(v []rune) runesV
Runes returns stringer/JSON marshaler interface implementation for the rune slice type.
func Runesp ¶ added in v0.105.0
func Runesp(p *[]rune) runesP
Runesp returns stringer/JSON marshaler interface implementation for the pointer to the rune slice type.
func String ¶
func String(v string) stringV
String returns stringer/JSON marshaler interface implementation for the string type.
func StringBool ¶
func StringBoolp ¶
func StringBytes ¶
func StringBytesp ¶
func StringComplex128 ¶
func StringComplex128(k string, v complex128) kvp
func StringComplex128p ¶
func StringComplex128p(k string, v *complex128) kvp
func StringComplex64 ¶
func StringComplex64p ¶
func StringDuration ¶
func StringDurationp ¶
func StringError ¶
func StringFloat32 ¶
func StringFloat32p ¶
func StringFloat64 ¶
func StringFloat64p ¶
func StringFunc ¶ added in v0.92.0
func StringInt16 ¶
func StringInt16p ¶
func StringInt32 ¶
func StringInt32p ¶
func StringInt64 ¶
func StringInt64p ¶
func StringInt8 ¶
func StringInt8p ¶
func StringIntp ¶
func StringReflect ¶
func StringReflect(k string, v interface{}) kvp
func StringRunes ¶
func StringRunesp ¶
func StringStringp ¶
func StringTime ¶
func StringTimep ¶
func StringUint ¶
func StringUint16 ¶
func StringUint16p ¶
func StringUint32 ¶
func StringUint32p ¶
func StringUint64 ¶
func StringUint64p ¶
func StringUint8 ¶
func StringUint8p ¶
func StringUintp ¶
func StringUintptr ¶
func StringUintptrp ¶
func Stringp ¶ added in v0.105.0
func Stringp(p *string) stringP
Stringp returns stringer/JSON marshaler interface implementation for the pointer to the string type.
func Text ¶
func Text(v encoding.TextMarshaler) textV
Text returns stringer/JSON marshaler interface implementation for the encoding.TextMarshaler type.
func TextAny ¶
func TextAny(k encoding.TextMarshaler, v interface{}) kvp
func TextBool ¶
func TextBool(k encoding.TextMarshaler, v bool) kvp
func TextBoolp ¶
func TextBoolp(k encoding.TextMarshaler, v *bool) kvp
func TextBytes ¶
func TextBytes(k encoding.TextMarshaler, v []byte) kvp
func TextBytesp ¶
func TextBytesp(k encoding.TextMarshaler, v *[]byte) kvp
func TextComplex128 ¶
func TextComplex128(k encoding.TextMarshaler, v complex128) kvp
func TextComplex128p ¶
func TextComplex128p(k encoding.TextMarshaler, v *complex128) kvp
func TextComplex64 ¶
func TextComplex64(k encoding.TextMarshaler, v complex64) kvp
func TextComplex64p ¶
func TextComplex64p(k encoding.TextMarshaler, v *complex64) kvp
func TextDuration ¶
func TextDuration(k encoding.TextMarshaler, v time.Duration) kvp
func TextDurationp ¶
func TextDurationp(k encoding.TextMarshaler, v *time.Duration) kvp
func TextError ¶
func TextError(k encoding.TextMarshaler, v error) kvp
func TextFloat32 ¶
func TextFloat32(k encoding.TextMarshaler, v float32) kvp
func TextFloat32p ¶
func TextFloat32p(k encoding.TextMarshaler, v *float32) kvp
func TextFloat64 ¶
func TextFloat64(k encoding.TextMarshaler, v float64) kvp
func TextFloat64p ¶
func TextFloat64p(k encoding.TextMarshaler, v *float64) kvp
func TextFunc ¶ added in v0.92.0
func TextFunc(k encoding.TextMarshaler, v func() json.Marshaler) kvp
func TextInt ¶
func TextInt(k encoding.TextMarshaler, v int) kvp
func TextInt16 ¶
func TextInt16(k encoding.TextMarshaler, v int16) kvp
func TextInt16p ¶
func TextInt16p(k encoding.TextMarshaler, v *int16) kvp
func TextInt32 ¶
func TextInt32(k encoding.TextMarshaler, v int32) kvp
func TextInt32p ¶
func TextInt32p(k encoding.TextMarshaler, v *int32) kvp
func TextInt64 ¶
func TextInt64(k encoding.TextMarshaler, v int64) kvp
func TextInt64p ¶
func TextInt64p(k encoding.TextMarshaler, v *int64) kvp
func TextInt8 ¶
func TextInt8(k encoding.TextMarshaler, v int8) kvp
func TextInt8p ¶
func TextInt8p(k encoding.TextMarshaler, v *int8) kvp
func TextIntp ¶
func TextIntp(k encoding.TextMarshaler, v *int) kvp
func TextRaw ¶
func TextRaw(k encoding.TextMarshaler, v []byte) kvp
func TextReflect ¶
func TextReflect(k encoding.TextMarshaler, v interface{}) kvp
func TextRunes ¶
func TextRunes(k encoding.TextMarshaler, v []rune) kvp
func TextRunesp ¶
func TextRunesp(k encoding.TextMarshaler, v *[]rune) kvp
func TextString ¶
func TextString(k encoding.TextMarshaler, v string) kvp
func TextStringp ¶
func TextStringp(k encoding.TextMarshaler, v *string) kvp
func TextUint ¶
func TextUint(k encoding.TextMarshaler, v uint) kvp
func TextUint16 ¶
func TextUint16(k encoding.TextMarshaler, v uint16) kvp
func TextUint16p ¶
func TextUint16p(k encoding.TextMarshaler, v *uint16) kvp
func TextUint32 ¶
func TextUint32(k encoding.TextMarshaler, v uint32) kvp
func TextUint32p ¶
func TextUint32p(k encoding.TextMarshaler, v *uint32) kvp
func TextUint64 ¶
func TextUint64(k encoding.TextMarshaler, v uint64) kvp
func TextUint64p ¶
func TextUint64p(k encoding.TextMarshaler, v *uint64) kvp
func TextUint8 ¶
func TextUint8(k encoding.TextMarshaler, v uint8) kvp
func TextUint8p ¶
func TextUint8p(k encoding.TextMarshaler, v *uint8) kvp
func TextUintp ¶
func TextUintp(k encoding.TextMarshaler, v *uint) kvp
func TextUintptr ¶
func TextUintptr(k encoding.TextMarshaler, v uintptr) kvp
func TextUintptrp ¶
func TextUintptrp(k encoding.TextMarshaler, v *uintptr) kvp
func Texts ¶ added in v0.105.0
func Texts(a ...encoding.TextMarshaler) kvp
func Time ¶ added in v0.105.0
Time returns stringer/JSON marshaler interface implementation for the time time type.
func Timep ¶ added in v0.105.0
Timep returns stringer/JSON marshaler interface implementation for the pointer to the time time type.
func Uint ¶ added in v0.105.0
func Uint(v uint) uintV
Uint returns stringer/JSON marshaler interface implementation for the uint type.
func Uint16 ¶ added in v0.105.0
func Uint16(v uint16) uint16V
Uint16 returns stringer/JSON marshaler interface implementation for the uint16 type.
func Uint16p ¶ added in v0.105.0
func Uint16p(p *uint16) uint16P
Uint16p returns stringer/JSON marshaler interface implementation for the pointer to the uint16 type.
func Uint32 ¶ added in v0.105.0
func Uint32(v uint32) uint32V
Uint32 returns stringer/JSON marshaler interface implementation for the uint32 type.
func Uint32p ¶ added in v0.105.0
func Uint32p(p *uint32) uint32P
Uint32p returns stringer/JSON marshaler interface implementation for the pointer to the uint32 type.
func Uint64 ¶ added in v0.105.0
func Uint64(v uint64) uint64V
Uint64 returns stringer/JSON marshaler interface implementation for the uint64 type.
func Uint64p ¶ added in v0.105.0
func Uint64p(p *uint64) uint64P
Uint64p returns stringer/JSON marshaler interface implementation for the pointer to the uint64 type.
func Uint8 ¶ added in v0.105.0
func Uint8(v uint8) uint8V
Uint8 returns stringer/JSON marshaler interface implementation for the uint8 type.
func Uint8p ¶ added in v0.105.0
func Uint8p(p *uint8) uint8P
Uint8p returns stringer/JSON marshaler interface implementation for the pointer to the uint8 type.
func Uintp ¶ added in v0.105.0
func Uintp(p *uint) uintP
Uintp returns stringer/JSON marshaler interface implementation for the pointer to the uint type.
Types ¶
type Log ¶
type Log struct { Output io.Writer // Output is a destination for output. Flag int // Flag is a log properties. KV []KV // Key-values. Lvl func(int) KV // Function receives severity level and returns key-value pair which indicating severity level. Keys [4]encoding.TextMarshaler // Keys: 0 = original message; 1 = message excerpt; 2 = message trail; 3 = file path. Key uint8 // Key is a default/sticky message key: all except 1 = original message; 1 = message excerpt. Trunc int // Maximum length of the message excerpt after which the message excerpt is truncated. Marks [2][]byte // Marks: 0 = truncate; 1 = blank. Replace [][2][]byte // Replace ia a pairs of byte slices to replace in the message excerpt. }
Log is a JSON logger/writer.
func GELF ¶
func GELF() Log
GELF returns a GELF formater <https://docs.graylog.org/en/latest/pages/gelf.html>.
func (Log) Level ¶ added in v0.111.0
Level returns copy of the logger with an additional key-value pair which indicating severity level. Level is syntactic sugar replacing the often repeated call to the more verbose New method to set the severity level. Copy of the original severity level key-value pair has a lower priority than the priority of the newer severity level key-value pair.
func (Log) New ¶ added in v0.105.0
New returns copy of the logger with additional key-values. Copy of the original key-values has the priority lower than the priority of the newer key-values.
type Logger ¶ added in v0.87.0
type Logger interface { io.Writer // New returns copy of the logger with an additional key-values. // Copy of the original key-values should have a lower priority // than the priority of the newer key-values. New(...KV) Logger // Level returns copy of the logger with an additional key-value pair // which indicating severity level. // Level is syntactic sugar replacing the often repeated call to // the more verbose New method to set the severity level. // Copy of the original severity level key-value pair should have a lower // priority than the priority of the newer severity level key-value pair. Level(int) Logger }