logfmt

package module
v0.0.0-...-867c8dd Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 4 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GoDoc Go Report Card CI

logfmt

This module allows to encode a list of key/value pairs in logfmt format.

Example

package main

import (
	"bytes"
	"fmt"

	"github.com/arnumina/logfmt"
)

func main() {
	buf := bytes.Buffer{}
	logfmt.Encode(&buf, "year", 2020, "month", "July", "Tuesday", true)

	fmt.Println(buf.String())
}
year=2020 month="July" Tuesday=true

Copyright (c) 2020 Institut National de l'Audiovisuel

Documentation

Overview

Package logfmt allows to encode a list of key/value pairs in logfmt format.

The key must be a string.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(buf *bytes.Buffer, kv ...interface{})

Encode allows to encode a list of key/value pairs in logfmt format.

If the provided list is odd, the value "@ODD" is added at the end of the list. Similarly, if the key is not a string of characters, it is replaced by the value "@KEY".

Types

This section is empty.

Jump to

Keyboard shortcuts

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