logger

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Overview

Package logger provides a simple log interface that you can wrap whatever logging library you use into.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NopLogger

func NopLogger(_ string)

NopLogger is a Logger implementation that does nothing.

Types

type Logger

type Logger func(msg string)

Logger is a simple common ground to wrap whatever logging library the user prefers into.

func StdLogger

func StdLogger(logger *log.Logger) Logger

StdLogger is a Logger implementation that wraps stdlib log package.

If passed in logger is nil, it falls back to

log.New(os.Stderr, "", log.LstdFlags)

func (Logger) Log

func (l Logger) Log(msg string)

Log is the nil-safe way of using a Logger.

If l is nil it does nothing. Otherwise it calls l.

Jump to

Keyboard shortcuts

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