slogjson

package
v2.0.2-0...-0d99925 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package slogjson contains the slogger that writes logs in JSON.

Format

{
  "ts": "2019-09-10T20:19:07.159852-05:00",
  "level": "INFO",
  "logger_names": ["comp", "subcomp"],
  "msg": "hi",
  "caller": "slog/examples_test.go:62",
  "func": "cdr.dev/slog/sloggers/slogtest_test.TestExampleTest",
  "trace": "<traceid>",
  "span": "<spanid>",
  "fields": {
    "my_field": "field value"
  }
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make(ctx context.Context, w io.Writer) context.Context

Make creates a logger that writes JSON logs to the given writer. See package level docs for the format. If the writer implements Sync() error then it will be called when syncing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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