Documentation ¶
Index ¶
- type FmtText
- type FmtTextBuilder
- func (b *FmtTextBuilder) Build() *FmtText
- func (b *FmtTextBuilder) Color() *FmtTextBuilder
- func (b *FmtTextBuilder) DoubleSpace() *FmtTextBuilder
- func (b *FmtTextBuilder) LevelFirst() *FmtTextBuilder
- func (b *FmtTextBuilder) NoHeaders() *FmtTextBuilder
- func (b *FmtTextBuilder) NoLevel() *FmtTextBuilder
- func (b *FmtTextBuilder) NoTimestamp() *FmtTextBuilder
- func (b *FmtTextBuilder) Time(t LogTimestamp) *FmtTextBuilder
- func (b *FmtTextBuilder) Upper() *FmtTextBuilder
- type LogTimestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FmtText ¶
type FmtText struct {
// contains filtered or unexported fields
}
FmtText struct describes the different manipulations and processing that a Text LogFormatter can apply to a LogMessage
func (*FmtText) FmtMetadata ¶
FmtMetadata method is a general-purpose converter for map[string]interface{} metadata, to display it in a somewhat human readable format, as a string.
type FmtTextBuilder ¶
type FmtTextBuilder struct {
// contains filtered or unexported fields
}
FmtTextBuilder struct will define the base of a custom FmtText object, which will take in different options in the form of methods that will define its configuration.
Then, the Build() method can be called to return a FmtText object
func (*FmtTextBuilder) Build ¶
func (b *FmtTextBuilder) Build() *FmtText
Build method will ensure the mandatory elements of FmtText are set and set them as default if otherwise, returning a pointer to a (custom) FmtText object
func (*FmtTextBuilder) Color ¶
func (b *FmtTextBuilder) Color() *FmtTextBuilder
Color method will set a FmtTextBuilder's colored element to true, and return itself to allow method chaining
func (*FmtTextBuilder) DoubleSpace ¶
func (b *FmtTextBuilder) DoubleSpace() *FmtTextBuilder
DoubleSpace method will set a FmtTextBuilder's doubleSpace element to true, and return itself to allow method chaining
func (*FmtTextBuilder) LevelFirst ¶
func (b *FmtTextBuilder) LevelFirst() *FmtTextBuilder
LevelFirst method will set a FmtTextBuilder's levelFirst element to true, and return itself to allow method chaining
func (*FmtTextBuilder) NoHeaders ¶
func (b *FmtTextBuilder) NoHeaders() *FmtTextBuilder
NoHeaders method will set a FmtTextBuilder's noHeaders element to true, and return itself to allow method chaining
func (*FmtTextBuilder) NoLevel ¶
func (b *FmtTextBuilder) NoLevel() *FmtTextBuilder
NoLevel method will set a FmtTextBuilder's noLevel element to true, and return itself to allow method chaining
func (*FmtTextBuilder) NoTimestamp ¶
func (b *FmtTextBuilder) NoTimestamp() *FmtTextBuilder
NoTimestamp method will set a FmtTextBuilder's noTimestamp element to true, and return itself to allow method chaining
func (*FmtTextBuilder) Time ¶
func (b *FmtTextBuilder) Time(t LogTimestamp) *FmtTextBuilder
Time method will set a FmtTextBuilder's timeFormat, and return itself to allow method chaining
func (*FmtTextBuilder) Upper ¶
func (b *FmtTextBuilder) Upper() *FmtTextBuilder
Upper method will set a FmtTextBuilder's upper element to true, and return itself to allow method chaining
type LogTimestamp ¶
type LogTimestamp string
LogTimestamp type will define the compatible timestamp formatting strings which can be used
const ( LTRFC3339Nano LogTimestamp = time.RFC3339Nano LTRFC3339 LogTimestamp = time.RFC3339 LTRFC822Z LogTimestamp = time.RFC822Z LTRubyDate LogTimestamp = time.RubyDate LTUnixNano LogTimestamp = "UNIX_NANO" LTUnixMilli LogTimestamp = "UNIX_MILLI" LTUnixMicro LogTimestamp = "UNIX_MICRO" )
func (LogTimestamp) String ¶
func (lt LogTimestamp) String() string
String method is an implementation of the Stringer interface, to idiomatically convert a LogTimestamp into its string representation