jfrog-client-go icon indicating copy to clipboard operation
jfrog-client-go copied to clipboard

Yarn - Rewording log messages

Open agrasth opened this issue 9 months ago • 0 comments

  • [x] All tests passed. If this feature is not already covered by the tests, I added new tests.
  • [x] All static analysis checks passed.
  • [x] This pull request is on the dev branch.
  • [x] I used gofmt for formatting the code before submitting the pull request.

Improve RetryExecutor Logging with Enhanced Context and Clarity

🎯 Overview

Enhanced the RetryExecutor.LogRetry() function to provide more informative and contextual logging for better debugging and monitoring of retry operations.

Changes Made

Enhanced Log Message Structure

  • Clear attempt labeling: [Initial attempt] vs [Retry X/Y] for better progress tracking
  • Consistent formatting: Improved message structure with clear error separation
  • Contextual information: More descriptive messages for different scenarios

Improved Log Levels

  • ERROR: Final failed attempts (critical issues)
  • WARN: Retry attempts with errors (expected during retries)
  • INFO: Successful operations after retries (important milestones)
  • DEBUG: First-try successes (routine operations)

Before:

[Warn] (Attempt 1) - Failure occurred while sending POST request to https://ftdr.jfrog.io/artifactory/api/search/aql: Post " https://ftdr.jfrog.io/artifactory/api/search/aql": dial tcp 34.74.126.177:443: i/o timeout

After:

WARN: [Retry 1/5] network timeout - Error: timeout error
WARN: [Retry 2/5] network timeout - Error: timeout error
INFO: [Retry 3/5] network timeout - Succeeded after 3 retries

agrasth avatar May 28 '25 19:05 agrasth