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.
How Good Are My USB Cables? - In this video, I engage in a deeper exploration of USB testing, encountering a range of trials and tribulations along the way. First up, I attempt to test a couple of USB cables and discuss their data lines' peculiar situatedness. Then, I delve into the assembly of the PCB boards, sourced from PCBWay, which surely turned into a learning voyage than an easy sail. The first version faced challenges of misordered large-frame stencil, unseen connection problems, and even DRC errors in the submission process. Not dwell on that, I redesign and bring to table Version 2, complete with USB connectors with broken-out pins and designed for visual inspection ease. Although this version demonstrated success, soldering difficulties and bad connections persisted. Considering all the hurdles, I decide to let PCBWay handle the assembly for the next version. For future strategies, adding test points and eliminating the lithium-ion charging circuit seemed more practically viable. Peeping into version 3, testing points for all USB cable pins have been added and even an option to break out actual USB connections, all towards ensuring an improved error checking and usefulness of the assembly.
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