Reducing visual noise in terminal output

I recently moved to a more daily build and, aside from a much more serious issue I’m trying to troubleshoot, my terminal output is now filled with a ton of visual noise. This makes it very difficult for me to see the stuff that I want in there.

Here’s what I’m seeing on EVERY line:

2013-02-13 12:25:15.352 Corona Simulator[32796:707] 

Is there anyway to turn this off so it goes back to only displaying that info at the beginning?

Thanks! [import]uid: 136105 topic_id: 35882 reply_id: 335882[/import]

Take a look here: http://developer.coronalabs.com/code/collected-print-statement
The print function collects all your print statements and then dump()'s them out in one go to the terminal. This reduces the line start noise you’re seeing. The downside is that you need to print everything you want to see first, then dump it, but this is not a massive drawback for most code unless you’re running time based iterations. [import]uid: 8271 topic_id: 35882 reply_id: 142681[/import]

Thanks for the reply and the link, but getting my print statements in real time is usually pretty important. That said, overwriting print() to put a new line before my output might make things slightly better. Good idea.

I’m just really confused why Corona would put something in that’s a hindrance with no advantages (that I can imagine–perhaps I’m missing something). [import]uid: 136105 topic_id: 35882 reply_id: 142715[/import]

It’s only there in the Mac terminal but I think you might be better off using the debugger? I’ve not tried it myself.

You could modify the print function to add a tab to the start of each line, giving a natural, large visual indent. [import]uid: 8271 topic_id: 35882 reply_id: 142717[/import]

I’ve never gotten the debugger to work, but it’s probably just me doing it wrong.

I did find a solution, though, using sed.

In the bash script I use to have the simulator run what’s in the current directory, I put:

/Applications/CoronaSDK/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator ./ 2\>&1 | sed -e 's/^.\*] //'

This strips out the timestamp :slight_smile: Yey, for UNIX.

There’s more on this here: http://stackoverflow.com/questions/14870822/how-can-i-rewrite-the-terminal-output-of-a-program [import]uid: 136105 topic_id: 35882 reply_id: 142775[/import]

Take a look here: http://developer.coronalabs.com/code/collected-print-statement
The print function collects all your print statements and then dump()'s them out in one go to the terminal. This reduces the line start noise you’re seeing. The downside is that you need to print everything you want to see first, then dump it, but this is not a massive drawback for most code unless you’re running time based iterations. [import]uid: 8271 topic_id: 35882 reply_id: 142681[/import]

Thanks for the reply and the link, but getting my print statements in real time is usually pretty important. That said, overwriting print() to put a new line before my output might make things slightly better. Good idea.

I’m just really confused why Corona would put something in that’s a hindrance with no advantages (that I can imagine–perhaps I’m missing something). [import]uid: 136105 topic_id: 35882 reply_id: 142715[/import]

It’s only there in the Mac terminal but I think you might be better off using the debugger? I’ve not tried it myself.

You could modify the print function to add a tab to the start of each line, giving a natural, large visual indent. [import]uid: 8271 topic_id: 35882 reply_id: 142717[/import]

And…as I was stumbling around looking for a solution to a seemingly unrelated problem, I found out why the timestamp is necessary now in the Mac terminal.

http://www.coronalabs.com/blog/2012/09/19/faq-wednesday-iphone-5-and-ios-6/ (see #5)

Basically, the change on the Corona SDK was necessary due to some changes by Apple in order to show print() output at all–or something like that. [import]uid: 136105 topic_id: 35882 reply_id: 143556[/import]

I’ve never gotten the debugger to work, but it’s probably just me doing it wrong.

I did find a solution, though, using sed.

In the bash script I use to have the simulator run what’s in the current directory, I put:

/Applications/CoronaSDK/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator ./ 2\>&1 | sed -e 's/^.\*] //'

This strips out the timestamp :slight_smile: Yey, for UNIX.

There’s more on this here: http://stackoverflow.com/questions/14870822/how-can-i-rewrite-the-terminal-output-of-a-program [import]uid: 136105 topic_id: 35882 reply_id: 142775[/import]

And…as I was stumbling around looking for a solution to a seemingly unrelated problem, I found out why the timestamp is necessary now in the Mac terminal.

http://www.coronalabs.com/blog/2012/09/19/faq-wednesday-iphone-5-and-ios-6/ (see #5)

Basically, the change on the Corona SDK was necessary due to some changes by Apple in order to show print() output at all–or something like that. [import]uid: 136105 topic_id: 35882 reply_id: 143556[/import]

Take a look here: http://developer.coronalabs.com/code/collected-print-statement
The print function collects all your print statements and then dump()'s them out in one go to the terminal. This reduces the line start noise you’re seeing. The downside is that you need to print everything you want to see first, then dump it, but this is not a massive drawback for most code unless you’re running time based iterations. [import]uid: 8271 topic_id: 35882 reply_id: 142681[/import]

Thanks for the reply and the link, but getting my print statements in real time is usually pretty important. That said, overwriting print() to put a new line before my output might make things slightly better. Good idea.

I’m just really confused why Corona would put something in that’s a hindrance with no advantages (that I can imagine–perhaps I’m missing something). [import]uid: 136105 topic_id: 35882 reply_id: 142715[/import]

It’s only there in the Mac terminal but I think you might be better off using the debugger? I’ve not tried it myself.

You could modify the print function to add a tab to the start of each line, giving a natural, large visual indent. [import]uid: 8271 topic_id: 35882 reply_id: 142717[/import]

I’ve never gotten the debugger to work, but it’s probably just me doing it wrong.

I did find a solution, though, using sed.

In the bash script I use to have the simulator run what’s in the current directory, I put:

/Applications/CoronaSDK/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator ./ 2\>&1 | sed -e 's/^.\*] //'

This strips out the timestamp :slight_smile: Yey, for UNIX.

There’s more on this here: http://stackoverflow.com/questions/14870822/how-can-i-rewrite-the-terminal-output-of-a-program [import]uid: 136105 topic_id: 35882 reply_id: 142775[/import]

And…as I was stumbling around looking for a solution to a seemingly unrelated problem, I found out why the timestamp is necessary now in the Mac terminal.

http://www.coronalabs.com/blog/2012/09/19/faq-wednesday-iphone-5-and-ios-6/ (see #5)

Basically, the change on the Corona SDK was necessary due to some changes by Apple in order to show print() output at all–or something like that. [import]uid: 136105 topic_id: 35882 reply_id: 143556[/import]

Take a look here: http://developer.coronalabs.com/code/collected-print-statement
The print function collects all your print statements and then dump()'s them out in one go to the terminal. This reduces the line start noise you’re seeing. The downside is that you need to print everything you want to see first, then dump it, but this is not a massive drawback for most code unless you’re running time based iterations. [import]uid: 8271 topic_id: 35882 reply_id: 142681[/import]

Thanks for the reply and the link, but getting my print statements in real time is usually pretty important. That said, overwriting print() to put a new line before my output might make things slightly better. Good idea.

I’m just really confused why Corona would put something in that’s a hindrance with no advantages (that I can imagine–perhaps I’m missing something). [import]uid: 136105 topic_id: 35882 reply_id: 142715[/import]

It’s only there in the Mac terminal but I think you might be better off using the debugger? I’ve not tried it myself.

You could modify the print function to add a tab to the start of each line, giving a natural, large visual indent. [import]uid: 8271 topic_id: 35882 reply_id: 142717[/import]

I’ve never gotten the debugger to work, but it’s probably just me doing it wrong.

I did find a solution, though, using sed.

In the bash script I use to have the simulator run what’s in the current directory, I put:

/Applications/CoronaSDK/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator ./ 2\>&1 | sed -e 's/^.\*] //'

This strips out the timestamp :slight_smile: Yey, for UNIX.

There’s more on this here: http://stackoverflow.com/questions/14870822/how-can-i-rewrite-the-terminal-output-of-a-program [import]uid: 136105 topic_id: 35882 reply_id: 142775[/import]