when outputting lots of information (like a running game) i found that a "csv-like" format is actually the best compromise between readability and being structured. Just log "header_1;header2;... value_1;value_2;..." you can still grep it, or redirect to a file and parse later
You say “cave dweller debugging”, I say debug logging
21–30 of 139 posts
Re: You say “cave dweller debugging”, I say debug logging
#22Re: You say “cave dweller debugging”, I say debug logging
#23You can't debug a program that ran in the past, but you can read its info-level logs.
Re: You say “cave dweller debugging”, I say debug logging
#24Re: You say “cave dweller debugging”, I say debug logging
#25No doubt there is a place (or indeed a need) for debug (or trace) logging in environments where you can’t simply pause execution. However, in development environments you would be foolish not to use the (vastly superior) tooling available. I think many developers shy away from debuggers simply because they haven't taken the time to understand how to use them effectively, whereas everyone knows how to write a log stat…
For some operations, running them in debug mode means they are 10 times slower, turning a 30sec operation (such as parsing big files into memory) into 5 minutes. If I'm relatively certain of what the problem is and I solve it in less than ~5 tries, I saved time.
Re: You say “cave dweller debugging”, I say debug logging
#26Re: You say “cave dweller debugging”, I say debug logging
#27Earlier quoted context omitted.
If you can show me a debugger that will work on a PHP application in the Symfony framework, runs on Mac, and is not built on Eclipse or a similar lumbering monstrosity, I will gladly give it a try. (Hell, I tried PHPStorm, but it's just so painful to use...) Until and unless such a thing appears, debug logging is pretty much what I've got. (And given the complexity of the project in question, and the fact that I'm ba…
I dont personally use PHP so I cant really vouch for it, but I just asked a friend and he uses Xdebug in vscode (on an M1 mac).
Re: You say “cave dweller debugging”, I say debug logging
#28No doubt there is a place (or indeed a need) for debug (or trace) logging in environments where you can’t simply pause execution. However, in development environments you would be foolish not to use the (vastly superior) tooling available. I think many developers shy away from debuggers simply because they haven't taken the time to understand how to use them effectively, whereas everyone knows how to write a log stat…
There are two situations that I encounter that make step through debugging difficult or impossible, and for a lot of my work both apply. A) When developing for a microcontroller (however large or small). Stepping debuggers are limited, and sometimes unavailable at all. Most are clunky. ARM is the best here. B) Running real time things. E.g. you can't step through a Bluetooth comms process because the moment you hit a…
C) debugging signal handlers is somewhere between tricky and impossible depending on the scenario because of how debuggers work.
D) debugging optimized code. -O2 or -O3 code will have everything executing out of order, all variables are optimizes out, everything is inlined, etc.
Re: You say “cave dweller debugging”, I say debug logging
#29I'm having the same issues... Although I'm not a full time developer, I do some small coding and I'm also sort of responsible for the dev team. I rarely use a debugger. I do most of debugging through logging. There are 2 advantages that I see: - it forces me to add the logs where they are needed to understand the flow of the application - it forces me to make those logs actually usable, readable and understandable De…
The need for this balance is why I don't completely agree with the article.
If I'm debugging something with log messages, I put way more detail into it than I want to see in production even at LogLevel.DEBUG.