youtube-to-anchorfm icon indicating copy to clipboard operation
youtube-to-anchorfm copied to clipboard

Logging enhancement and screenshotting logic to improve action debugging

Open VasilisTako opened this issue 11 months ago • 1 comments

To improve the observability and debugging capabilities of our deployment process, I propose introducing a new environment variable named FULL_LOG. When set to true, this variable will trigger the logging of additional information during the upload process. This enhanced logging could include verification of element discovery and other pertinent details, which are yet to be precisely defined.

Moreover, a critical enhancement to our error handling strategy could involve capturing a screenshot in the event of an exception. This will provide visual context to the errors, significantly helping in their diagnosis. Below is a snippet of the implementation for capturing a screenshot upon encountering an exception:

try {
  ...............
} catch (error) {
  const screenshotPathError = '/path/to/screenshots/error.png';
  await page.screenshot({path: screenshotPathError});
  console.log(`Screenshot taken: ${screenshotPathError}`);
}

To ensure these screenshots are readily accessible for analysis, I suggest adding the following step to our GitHub Actions workflow. This step will upload the captured screenshots as artifacts, making them available for review:

- name: Upload screenshots
  uses: actions/upload-artifact@v2
  if: always()
  with:
    name: screenshots
    path: /path/to/screenshots/

VasilisTako avatar Mar 12 '24 18:03 VasilisTako

Looking good

TheJoin95 avatar Mar 12 '24 21:03 TheJoin95