iolog

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 4 Imported by: 0

README

iolog

Build Status

Golang io.ReadWriteCloser wrapper with log buffer

Used for logging read/write operation (with serial devices in my case) which to noise for direct logging but very helpful in case of hardware error.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyFunc

type AnyFunc func() (interface{}, error)

type IOFunc

type IOFunc func([]byte) (int, error)

type IOLog

type IOLog struct {
	// contains filtered or unexported fields
}

func New

func New(l int) *IOLog

func (*IOLog) LastRecord

func (l *IOLog) LastRecord() *Record

func (*IOLog) Len

func (l *IOLog) Len() int

func (*IOLog) LogAny

func (l *IOLog) LogAny(t string, fn AnyFunc, logdata bool) (interface{}, error)

func (*IOLog) LogIO

func (l *IOLog) LogIO(t string, fn IOFunc, p []byte) (int, error)

func (*IOLog) Start

func (l *IOLog) Start()

func (*IOLog) Stop

func (l *IOLog) Stop() []*Record

func (*IOLog) String

func (l *IOLog) String() string

type Record

type Record struct {
	Tag   string
	Start time.Time
	Stop  time.Time
	Data  interface{}
	Error error
}

func (*Record) String

func (r *Record) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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