Documentation ¶
Index ¶
- func Colorize(colorCode string, h hints.Hints, what string) string
- func ColorizeByLevel(l level.Level, h hints.Hints, what string) string
- func EncodeMultilineWithIndent(firstLineIndent, otherLinesIndent string, to encoding.TextEncoder, ...) error
- func EnsureWidth(width int32, cutOffIfTooLong bool, of string) string
- func IndentMultiline(firstLineIndent, otherLinesIndent string, message string) string
- func LevelColorizer(h hints.Hints) nlevel.Colorizer
- func ShouldColorize(h hints.Hints) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeMultilineWithIndent ¶
func EncodeMultilineWithIndent(firstLineIndent, otherLinesIndent string, to encoding.TextEncoder, message string) error
EncodeMultilineWithIndent will indent the given message per line with the given indents and writes the result to the given `to` encoding.TextEncoder. The first line can have a different indent than the following lines.
func EnsureWidth ¶
EnsureWidth will ensure that the given width is applied to the given string `of`. If the given string `of` is too short whitespaces will be added. If the string is too long and cutOffIfTooLong is true it will be cut of. If a negative value of `width` has nearly the same effect as it is positive. The only difference is, that in case of positive: whitespaces will be suffixed; in case of negative: whitespaces will be prefixed. If `width` is `0` this method will do nothing.
func IndentMultiline ¶
IndentMultiline will indent the given message per line with the given indents. The first line can have a different indent than the following lines.
func ShouldColorize ¶
Types ¶
This section is empty.