// Copyright 2009 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package iotestimport ()typewriteLoggerstruct {prefixstringwio.Writer}func ( *writeLogger) ( []byte) ( int, error) { , = .w.Write()if != nil {log.Printf("%s %x: %v", .prefix, [0:], ) } else {log.Printf("%s %x", .prefix, [0:]) }return}// NewWriteLogger returns a writer that behaves like w except// that it logs (using log.Printf) each write to standard error,// printing the prefix and the hexadecimal data written.func ( string, io.Writer) io.Writer {return &writeLogger{, }}typereadLoggerstruct {prefixstringrio.Reader}func ( *readLogger) ( []byte) ( int, error) { , = .r.Read()if != nil {log.Printf("%s %x: %v", .prefix, [0:], ) } else {log.Printf("%s %x", .prefix, [0:]) }return}// NewReadLogger returns a reader that behaves like r except// that it logs (using log.Printf) each read to standard error,// printing the prefix and the hexadecimal data read.func ( string, io.Reader) io.Reader {return &readLogger{, }}
The pages are generated with Goldsv0.4.9. (GOOS=linux GOARCH=amd64)