filelogwriter

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLogWriter

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

FileLogWriter is an io.Writer that does not keep any file handles open any longer than necessary.

func NewFileLogWriter

func NewFileLogWriter(file string) (flw *FileLogWriter, err error)

NewFileLogWriter constructs a new FileLogWriter instance with the settings given.

`file` is the local filesystem output destination `flag` is the os.Flags setting, default is os.O_CREATE|os.O_WRONLY|os.O_APPEND `mode` is the file mode setting, default is 0644

func (*FileLogWriter) SetFlag

func (flw *FileLogWriter) SetFlag(flag int) *FileLogWriter

SetFlag is a chainable method for setting the file flags used to open a new file handle each time Write is called

func (*FileLogWriter) SetMode

func (flw *FileLogWriter) SetMode(mode os.FileMode) *FileLogWriter

SetMode is a chainable method for setting the file mode used to open a new file handle each time Write is called

func (*FileLogWriter) Write

func (flw *FileLogWriter) Write(p []byte) (n int, err error)

Write opens the log file, writes the data given and returns the bytes written and the error state after closing the open file handle.

func (*FileLogWriter) WriteString

func (flw *FileLogWriter) WriteString(s string) (n int, err error)

WriteString is a convenience wrapper around Write()

Jump to

Keyboard shortcuts

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