mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
Merge pull request #3349 from stweil/master
Disable most Leptonica messages for tesseract by default
This commit is contained in:
commit
c7653bf59f
@ -25,6 +25,7 @@
|
||||
#if defined(__USE_GNU)
|
||||
# include <cfenv> // for feenableexcept
|
||||
#endif
|
||||
#include <cstdlib> // for std::getenv
|
||||
#include <iostream>
|
||||
|
||||
#include <allheaders.h>
|
||||
@ -619,10 +620,13 @@ int main(int argc, char **argv) {
|
||||
std::vector<std::string> vars_vec;
|
||||
std::vector<std::string> vars_values;
|
||||
|
||||
#if defined(NDEBUG)
|
||||
// Disable debugging and informational messages from Leptonica.
|
||||
setMsgSeverity(L_SEVERITY_ERROR);
|
||||
#endif
|
||||
if (std::getenv("LEPT_MSG_SEVERITY")) {
|
||||
// Get Leptonica message level from environment variable.
|
||||
setMsgSeverity(L_SEVERITY_EXTERNAL);
|
||||
} else {
|
||||
// Disable debugging and informational messages from Leptonica.
|
||||
setMsgSeverity(L_SEVERITY_ERROR);
|
||||
}
|
||||
|
||||
#if defined(HAVE_TIFFIO_H) && defined(_WIN32)
|
||||
/* Show libtiff errors and warnings on console (not in GUI). */
|
||||
|
Loading…
Reference in New Issue
Block a user