1 function log(stack_frame_index
, obj
)
2 local info
= debug
.getinfo(stack_frame_index
, 'Sl')
4 if type(obj
) == 'string' then
9 love
.filesystem
.append('log', info
.short_src
..':'..info
.currentline
..': '..msg
..'\n')
12 -- for section delimiters we'll use specific Unicode box characters
13 function log_start(name
, stack_frame_index
)
14 if stack_frame_index
== nil then
17 -- I'd like to use the unicode character \u{250c} here, but it doesn't work
19 log(stack_frame_index
, '[ u250c ' .. name
)
21 function log_end(name
, stack_frame_index
)
22 if stack_frame_index
== nil then
25 -- I'd like to use the unicode character \u{2518} here, but it doesn't work
27 log(stack_frame_index
, '] u2518 ' .. name
)
30 function log_new(name
, stack_frame_index
)
31 if stack_frame_index
== nil then
34 log_end(name
, stack_frame_index
)
35 log_start(name
, stack_frame_index
)
38 -- rendering graphical objects within sections/boxes