|
|
|
|
|
by TeMPOraL
998 days ago
|
|
Yes, except the problem here is that if the app crashes, you'll lose all the messages in the bundle. That's why people tend to use side-effect logging that persists messages immediately. That, and because it keeps timestamps correct. I suppose this approach would make most sense in event-driven apps where no particular processing takes any meaningful amount of time, so you're constantly revisiting the top-level loop, where the "logging layer" could live. However, most software isn't written this way. |
|
If you were to take hard crashes into account, you would even have to log before each operation instead of after, basically reverting to printf-debugging.