logutil

package
v0.0.0-...-58998d9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package logutil has utilities for working with the Go Kit log package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

func Fatal(logger log.Logger, args ...interface{})

Fatal logs a error message and exits the process.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) endpoint.Middleware

LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any.

func NewServerLogger

func NewServerLogger(debug bool) log.Logger

NewServerLogger creates a standard logger for Kolide services. The logger will output JSON structured logs with a "severity" field set to either "info" or "debug". The acceptable level can be swapped by sending SIGUSR2 to the process.

func SetLevelKey

func SetLevelKey(logger log.Logger, key interface{}) log.Logger

SetLevelKey changes the "level" key in a Go Kit logger, allowing the user to set it to something else. Useful for deploying services to GCP, as stackdriver expects a "severity" key instead.

see https://github.com/go-kit/kit/issues/503

func WithError

func WithError(l log.Logger, err error) log.Logger

WithError returns a logger with severity as error along with the err value encapsulated

Types

This section is empty.

Jump to

Keyboard shortcuts

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