functions

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Colorize

func Colorize(colorCode string, h hints.Hints, what string) string

func ColorizeByLevel

func ColorizeByLevel(l level.Level, h hints.Hints, what string) string

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

func EnsureWidth(width int32, cutOffIfTooLong bool, of string) string

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

func IndentMultiline(firstLineIndent, otherLinesIndent string, message string) string

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 LevelColorizer

func LevelColorizer(h hints.Hints) nlevel.Colorizer

func ShouldColorize

func ShouldColorize(h hints.Hints) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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