title: How do you enable "quiet mode" when using Tesseract OCR from C++?
body: <p>I am statically linking to the Tesseract OCR engine on Windows from a command line program written in C++. I would like to initialize Tesseract such that if it is not a Debug build Tesseract does not  output text to the console window.</p>
  <p>There is an existing question about running the tesseract command line program (not using it as a library) in quiet mode on Linux, <a href="https://stackoverflow.com/questions/31806648/tesseract-quiet-mode">link</a>, with an answer stating that what you need to do is set the variable &quot;debug_file&quot; to &quot;/dev/null&quot; which clearly only makes sense on Linux but implies that the idea is to pipe Tesseract's verbosity to a log file. But even setting this variable to an arbitrary  file does nothing under Windows. Below I try to do it at initialization time:</p>
  <pre><code>GenericVector&lt;STRING&gt; vars;
  GenericVector&lt;STRING&gt; vals;
  vars.push_back(&quot;debug_file&quot;);
  vals.push_back(&quot;C:\\test\\tess.log&quot;);
  std::string data_path = &quot;garbage data path that will cause Init to issue errors&quot;;
  auto result = ocr_-&gt;Init(data_path.c_str(), &quot;eng&quot;, tesseract::OEM_TESSERACT_ONLY, NULL, 0, &amp;vars, &amp;vals, false);
  </code></pre>
  <p>and still see</p>
  <pre><code>Error opening data file 
  garbage_path_that_will_cause_init_to_issue_errors_to_the_cmd_line/eng.traineddata
  Please make sure the TESSDATA_PREFIX environment variable is set to your &quot;tessdata&quot; directory.
  Failed loading language 'eng'
  Tesseract couldn't load any languages!
  </code></pre>
  <p>whether &quot;tess.log&quot; exists or doesn't exist. When I search for documentation of the variables you can pass to Tesseract I see people citing the following as the definitive list: <a href="http://www.sk-spell.sk.cx/tesseract-ocr-parameters-in-302-version" rel="nofollow noreferrer">link</a>, which does indeed contain &quot;debug_file&quot; as a variable but has no variable about &quot;quiet mode&quot; or verbosity.</p>