Skip to content

SolfeGuido/LogGuido

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

LogGuido

A threaded rolling logger for löve2D.

Used by SolfeGuido

Usage :

-- Start the thread
Logger.init(config)

-- Log a simple message
Logger.log('INFO', 'message')
-- or
Logger.info('message')

-- Warning, error, fatal
Logger.warning(warningMessage)
Logger.error(errorMessage)
Logger.fatal(fatalMessage)

-- Try to execute an action, log if it fails
local result = Logger.try('To get a value', function() return getAValue() end, 'defaultValue')

-- Close the thread
Logger.close()

Configuration

The configuration given at the init function can contains the following values :

logFile : Name of the file where to write the logs (default = logs.log)

maxSize : Max size of the file where the logs are written, once this size is reached, the logger creates a new zip file with the content of the logFile and deletes the logFile (default = 5MB)

logZip : Name of the zip file to create once the logFile is too big. (default = <logFile>.zip)

This logger only creates one zip, if the zip file already exists, it will just delete it

About

Threaded logger for löve2d

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages