code: private void showAssertInfo(IAssert<?> assertCommand, AssertionError ex, boolean failedTest) {
          ITestResult testResult = Reporter.getCurrentTestResult();
  
          // Checks whether the soft assert was called in a TestNG test run or else within a Java application.
          String methodName = "main";
          if (testResult != null) {
              methodName = testResult.getMethod().getMethodName();
          }
  
          StringBuilder sb = new StringBuilder();
          sb.append("Soft Assert ");
          if (assertCommand.getMessage() != null && !assertCommand.getMessage().trim().isEmpty()) {
              sb.append("[").append(assertCommand.getMessage()).append("] ");
          }
          if (failedTest) {
              sb.append("failed in ");
          } else {
              sb.append("passed in ");
          }
          sb.append(methodName).append("()\n");
          if (failedTest) {
              sb.append(ExceptionUtils.getStackTrace(ex));
          }
          Reporter.log(sb.toString(), true);
      }
docs: Shows a message in Reporter based on the assert result and also includes the stacktrace for failed assert.
  
  @param assertCommand
  The assert conditions for current test.
  @param ex
  An {@link AssertionError} in case of failed assert, else null.
  @param failedTest
  A boolean {@code true} when the assert has failed.