log2file

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log2FileStruct

type Log2FileStruct struct {
	// Skip previous caller, usually the 1st is the good
	CallerSkip int

	DevMode bool

	LogFilename string
	// contains filtered or unexported fields
}

Log2FileStruct: Structure that hold methods to manage logging to file (errors and/or strings). On main program exit, logger must be closed using "CloseLogger" method: defer Logger.CloseLogger()

func Log2FileStructNew

func Log2FileStructNew(logFilename string, devMode bool) (l2f *Log2FileStruct)

Log2FileNew: Create a new Log2File structure

func (*Log2FileStruct) CloseLogger

func (l2f *Log2FileStruct) CloseLogger()

CloseLogger: Whan main program EXIT this method must to be called to properly close lo file.

func (*Log2FileStruct) Log

func (l2f *Log2FileStruct) Log(messageIn ...interface{}) (err error)

Log: Record "messageIn" to file, can be an error and/or a string NOTICE: first argument must be the error to speed up treatment. return a cleaned 'nil' error

Jump to

Keyboard shortcuts

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