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.

Top comments (0)