1
votes

I wanted to write a debugger for my Love2d game, but I can't print() to the command line. When I try to use print() nothing appears in the command line.

2
The title of the question doesn't match the description. If the question is about buffered output, could you come up with a better title? If the question is about Love2d debugging, could you update the description? - Paul Kulchenko

2 Answers

2
votes

On the command line:

love folder-that-contains-main.lua --console

It's a special command line flag that will attach a console to your game window and display print() commands.

0
votes

This might happen on some computers if you have console buffering turned on (by default). You can call this at the beginning of your main.lua and see if it helps:

io.stdout:setvbuf('no')