[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: debugging/logging question
- From: Norbert Kiesel <nkiesel@...>
- Date: Thu, 08 Oct 2009 15:20:40 -0700
Hi,
is it possible to get the name of a variable within Lua if I only have
the variable? I want to write a small helper function logger that
basically prints the name and the value of the variable
function logger(name, value) print(name, 'has value', value) end
foo = 'hello'
logger('foo', foo)
Now I'd like to just call "logger(foo)" and get the same output.
</nk>