title: How can I have karate.log call from javascript added to cucumber reports?
body: <p>I want to be able to write log statements, that get added to the karate.log file as well as to the Cucumber Reports that get generated when using standalone <code>karate.jar</code>.</p>
  
  <p>When I use <code>karate.log</code> from a javascript function it only adds the log statement to the <code>karate.log</code> file and not the cucumber report.</p>
  
  <p>I have also tried to do this from a <code>java</code> function as well by using both <code>slf4j</code> logger as well as the <code>com.intuit.karate.Logger</code> class. However both of these only add logs to the <code>karate.log</code> file and not to the cucumber reports.</p>
  
  <p>I need this because I am writing some common code for which I don't want my QA-Engineers to write <code>* print &lt;&gt;</code> statements in the karate feature files.</p>
  
  <p>I also looked at the <code>com.intuit.karate.core.ScriptBridge.log(Object... objects)</code> method which is what I am assuming gets called when you call <code>karate.log(..)</code>, it looks like it should work, but it isn't working for me.</p>
  
  <p>I am using karate-0.9.4, and here's what my <code>karate-config.js</code> looks like</p>
  
  <pre><code>function conf() {
  
      var env = karate.env // set the environment that is to be used for executing the test scripts
      var host = '&lt;some-host-name&gt;';
      var port = '443';
      var protocol = 'https';
      var basePath = java.lang.System.getenv('GOPATH') + '/src/karate-tests';
  
      // a custom 'intelligent' default
      if (!env) {
          env = 'dev';
      }
  
      var applicationURL = ((!port || port == '') || (port == '80' &amp;&amp; protocol == 'http') || (port == '443' &amp;&amp; protocol == 'https'))
      ? protocol + '://' + host
      : protocol + '://' + host + ":" + port;
  
      // Fail quickly if there is a problem establishing connection or if server takes too long to respond
      karate.configure('connectTimeout', 30000);
      karate.configure('readTimeout', 30000);
  
      // pretty print request and response
      //karate.configure('logPrettyRequest', true);
      //karate.configure('logPrettyResponse', true);
      karate.configure('printEnabled', true);
  
      // do not print steps starting with * in the reports
      //karate.configure('report',{showLog: true, showAllSteps: true });
  
      // Turn off SSL certificate check
      karate.configure('ssl', true);
  
      var config = {
          env: env,
          appBaseURL: applicationURL,
          sharedBasePath: basePath
      };
  
      karate.log("config.sharedBasePath = ", config.sharedBasePath)
      karate.log('karate.env = ', config.env);
      karate.log('config.appBaseURL = ', config.appBaseURL);
  
      return config
  }
  </code></pre>