🌈 ESP32-S3 Rainbow: ZX Spectrum Emulator Board! Get it on Crowd Supply →
View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
#CODE DEBUGGING #ERROR HANDLING #PROGRAMMING BEST PRACTICES #SERVER LOGGING #USER REPORTED BUGS

Hopefully, everyone agrees that you should have some form of logging in your production systems. I would also hope that nowadays everyone agrees that using some kind of centralised logging system that you can access without SSHing onto production boxes is the right way to do things.

But what should we log?

Typically we log errors and exceptions, we want to see when things go wrong. With this logging in place when we see a 500 error on the server we simply go and check the logs to see what the problem is.

We can also monitor our logs and detect an increase in errors - this can alert us to problems before they have a large impact on users.

To me, this is the bare minimum of logging - errors and exceptions.

What we also need are logs that follow the happy path of the code, we should be able to see that the code is flowing in the way we expect it to.

Why do we need this? What do we do when a user reports a problem?

Go and check the logs to see if something is broken - no errors or exceptions - what do we do now?

We need to be able to follow the code through its path of execution and see where it deviates from what we expect:

The user says: ā€œemails aren’t being sentā€:

Check the logs, I can see the system was told to send an email, I can see it generated the template, I don’t see it sending the email - there’s something wrong in the code after template generation.ā€

This is an invaluable tool in our debugging arsenal saving us a huge amount of troubleshooting time.

#CODE DEBUGGING #ERROR HANDLING #PROGRAMMING BEST PRACTICES #SERVER LOGGING #USER REPORTED BUGS

Related Posts

How do we debug? - Today, we dissected a classic programmer joke about the stages of debugging and why we find it funny while it reflects a dire situation. We pondered why our first instinct is to dismiss a bug, dug into invalid claims about machines, and appreciated the shift from denial and blame to accepting responsibility and finding solutions. After deconstructing the old stages of debugging, we reconstructed healthier, proactive stages with prime focus on problem-solving. Next, we explored different types of bugs from easy user interface bugs to the complex Heisenbugs. Lastly, I highlighted logging, debuggers, and good old human brainpower as instrumental tools for debugging. Be patient, be a detective.
Are you an effective team? - This blog outlines the absolute fundamental elements that any competent team needs to ensure smooth operations. It emphasizes the importance of continuous integration, continuous deployment, running effective unit tests, comprehensive code reviews, and the ability to run the system locally. The objective here is not to over-complicate procedures, but to streamline consistent quality through these five basic yet crucial practices which when implemented should mark an effective team.

Related Videos

ESP32 Remote Logging - Learn how to remotely monitor your Arduino devices by sending log messages to a central server using UDP and a paper trail. Get insights into how your hardware is performing, even when you can't physically access it.
The Hacker News Effect - The Website Didn't Catch Fire - Let's look at the traffic - Witness the Hacker News effect in action as the author's blog skyrocketed to popularity, easily handling massive traffic thanks to efficient hosting and Cloudfront!
We weren't really going for speed - but this gets quite fast... - Discover the process of sorting out issues with open loop mode and vibrations in 3D printers, while learning how to make the most out of leftover proof of concepts.
You Need Arduino GitHub Actions - Learn how to add GitHub badges to your Arduino projects, improving project visibility and attracting contributors. Set up automated build checks with GitHub Actions to prevent broken code merges.
Surprisingly not CR*P - Vibing hardware - Hey folks! In my latest adventure, we're taking a break from the vibe-coding game and diving straight into some hardware magic. Get ready as we haphazardly (but enthusiastically!) piece together components, hunt for missing wires and rogue capacitors, and finally emerge victorious with our very own PCB board. Shoutout to PCBWay for keeping the good vibes and great circuits flowing!
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening


Published

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts