DEV Community

Cover image for On the twelfth day of Enhancing: Debugging
Simon MacDonald for Begin

Posted on • Originally published at blog.begin.com

On the twelfth day of Enhancing: Debugging

We are at the end of our 12 Days of Enhancing series. We’ll give you some short instructions on debugging your new Enhance application.

Debugging

Since your Enhance application is running in the cloud, it’s not exactly like you can attach a debugger. Instead, we rely upon our old friend console.log. By judicious use of console.log we can inspect the crime scene that my code so often emulates.

To get logs from recent executions of your app, run the following command:

begin logs --env staging
Enter fullscreen mode Exit fullscreen mode

That output might get a bit verbose if you have a lot of traffic. Luckily, you can filter the logs by adding a filter parameter to the command.

begin logs --env staging --filter "my keyword"
Enter fullscreen mode Exit fullscreen mode

You might even want to wrap console.log in a function so you can turn on and off the output with an environment variable like we discussed yesterday.

Next Steps

Take some of the tidbits we’ve given you over the past 12 days and make something great with Enhance yourself. We'd love to hear about your project. Connect in our Discord server or on Mastodon @enhance_dev@fosstodon.org.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Cloudinary image

Zoom pan, gen fill, restore, overlay, upscale, crop, resize...

Chain advanced transformations through a set of image and video APIs while optimizing assets by 90%.

Explore

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay