Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 608 Bytes

File metadata and controls

31 lines (25 loc) · 608 Bytes

log-lib

A Library to ease logging of data

local log = require('./libs/log')
local filePath = './Output.lua'
local content = {
    key1 = 'value1',
    key2 = 'value2'
}
-- write into file:
log.write(content, filePath, "w+")

-- write into default error File, incl. traceback:
log.ErrorHandler(content, nil)

write

Default dataAccess is "w+"

log.write(content: <table|string>, filePath: <string>, dataAccess: <string>)
DataAccess:
"w" | "w+" | "a" | "a+"

ErrorHandler

log.ErrorHandler(content: <table|string>, filePath: <string|nil>, traceback: <boolean|nil>)