#debugging #automation #softwareengineering
- Useful Logging
Logs are one of the most basic and vital sources of information when debugging an application. Here are a few tips to make your logs more useful:
Aggregation is a must. In a distributed system, logs must be aggregated into a single location so that they can be queried.
Related logs should be linked by a unique, queryable identifier. Logs that originate from a single HTTP request should all have the same ID so that the flow of logic and data can be easily queried.
Logs should represent an action taken by the server.
Logs that are not directly useful should be suppressed in production to reduce noise.
- Build Tools
Focus on tasks that you do regularly. If you can find a way to write code so that a 30-minute debugging task becomes a 5-minute debugging task using a tool, you will save yourself time and effort.
Save yourself from doing the same debugging task twice by setting up monitoring after each bug is solved. If you spend a day debugging an issue, then it’s worth spending some extra time setting up monitoring to ensure that you can monitor for the same bug in the future.
- Focus on Increasing Value over Time Spent Ratio
Treat your time as the most valuable currency. Here are some ways to invest your time wisely:
Read code in critical parts of the application. Over time, you will become very familiar with the code, and debugging will go faster.
Write documentation around bugs that you fix. This will expand your impact through other engineers.
Focus on taking one step closer to the ultimate debugging experience through automation.