print("\076\111\103\103\101\114\058 \073\110\105\116\105\097\108\105\122\105\110\103 \118\097\114\105\097\098\108\101\115\046\046\046")local R={}print("\076\111\103\103\101\114\058 \067\111\110\115\116\114\117\099\116\105\110\103 \111\098\106\101\099\116\115\046\046\046")R.__index=R function R.new()local s=setmetatable({},R)s.log={}return s end function R.Log(R,...)table.insert(R.log,{os.time();...})end function R.Entries(R)return ipairs(R.log)end print("\076\111\103\103\101\114\058 \068\111\110\101\046")return R
--- A tool to record entries.
-- Creates a simple log, logs entries, and allows iteration over entries.
--
-- @author LastTalon
-- @version 0.1.1, 2020-10-01
-- @since 0.1
--
-- @module Logger

-- Variables --
print("Logger: Initializing variables...")

local Logger = {}

-- Local Objects --
print("Logger: Constructing objects...")

Logger.__index = Logger

--- The default Logger constructor.
-- Creates a new Logger with an empty log.
--
-- @return the new Logger
function Logger.new()
	local self = setmetatable({}, Logger)
	self.log = {}
	return self
end

--- Logs a new entry.
-- Inserts a new entry into the log. The entry includes the time it was logged
-- along with whatever paramters are passed.
--
-- @param ... parameters to log with the entry
function Logger:Log(...)
	table.insert(self.log, {os.time(), ...})
end

--- An iterator factory for the log.
-- Iterates over the log in the order that entries were added.
--
-- @return the iterator, its invariant, and its control variable
function Logger:Entries()
	return ipairs(self.log)
end

-- End --
print("Logger: Done.")

return Logger
