logger

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

README

billy-logger

GoDoc

This library wraps your billy.Filesystem and logs all calls made and their results. Simplest usage:

-fs := memfs.New()
+fs := logger.Wrap(memfs.New(), log.Println)

If you're debugging multiple Billy filesystems, you can prefix your log lines with this:

el := log.New(log.Writer(), "emptyfs: ", log.Flags())
rl := log.New(log.Writer(), "router : ", log.Flags())
ml := log.New(log.Writer(), "mergeFS: ", log.Flags())
fs := router.New(logger.Wrap(emptyfs.New(), el.Println))
fs.Mount("/all", logger.Wrap(mergeFS{}, ml.Println))
fs := logger.Wrap(fs, rl.Println)

Documentation

Overview

Package logger logs all Billy calls made.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(underlying billy.Basic, log func(msg ...interface{})) billy.Filesystem

Types

This section is empty.

Jump to

Keyboard shortcuts

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