Modul:Sandkasse/Chameleon222/Debug

Fra Wikipedia, den frie encyklopedi
Moduldokumentasjon


local debugStr_ = ''
 
function debugValue(value)
	debugStr_ = debugStr_ .. tostring(value) .. ' '
end
 
function debugDate(date)
	local dateT = {}
	if type(date) == 'number' then
		dateT = os.date('!*t', date)
	else
		dateT = date
	end
	debugStr_ = debugStr_ .. tostring(dateT.year) .. '-' .. tostring(dateT.month) .. '-' .. tostring(dateT.day) .. ' (' .. tostring(dateT.yday) .. ') '
end
 
function debugStr()
	if debugStr_ == '' then return '' end
	return '(' .. debugStr_ .. ')<br />'
end