zapkc

package
v0.0.0-...-211e212 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package zapkc contains internal code copied from zap that we need to adjust slightly but can't import

Index

Constants

View Source
const (
	Black termColor = iota + 30
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

Foreground colors.

Variables

View Source
var NoColor noColor
View Source
var UseColor = true

Functions

func CapitalColorLevelEncoder

func CapitalColorLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)

CapitalColorLevelEncoder serializes a Level to an all-caps string and adds color. For example, InfoLevel is serialized to "INFO" and colored blue.

func FormatEntryCaller

func FormatEntryCaller(path string, maxLen int) []byte

FormatEntryCaller formats a zapcore.EntryCaller to be displayed optimally given a maximum length. See test cases for examples.

Finally, my bachelor's degree in CS is put to use. Knew it would come in handy some day.

func NameEncoder

func NameEncoder(color Color) zapcore.NameEncoder

func ShortCallerEncoder

func ShortCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)

Types

type Color

type Color interface {
	Add(string) string
}

Color represents a text color.

Jump to

Keyboard shortcuts

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