Enhance Tesseract logging?

653 views
Skip to first unread message

Stefan Weil

unread,
Oct 3, 2019, 3:42:05 PM10/3/19
to tesseract-dev
Currently the log messages from tesseract and the training tools don't use a uniform logging API, but call tprintf, printf or fprintf to stderr.

It would be nice to have clear log levels (DEBUG, INFO, WARNING, ERROR) with distinct message texts.
It should be possible for users to suppress output from log levels, for example restrict messages to WARNING and ERROR only.
Third party software using the Tesseract API should be able to handle log messages with their own code.
Common logging libraries also allow advanced configurations which redirect the single log levels to different targets (stdout, stderr, file, syslog, ...).

Maybe both a functional and a stream based logging API would be helpful.

Any thoughts on this? Are these suggestions desirable?
Are there available solutions which can be used by the Tesseract code, or would a local implementation be sufficient?

Zdenko Podobny

unread,
Oct 6, 2019, 11:57:26 AM10/6/19
to tesser...@googlegroups.com
+1  for this.

Maybe also ASSERTS should be covered by logging too (ASSERTS  are disabled in release build win NDEBUG)

But from my perspective the biggest problem is that tesseract library fuctions should return value instead of printing text. This is the big bottleneck when using tesseract as library (e.g.  https://github.com/tesseract-ocr/tesseract/issues/1334).
 
Zdenko


št 3. 10. 2019 o 21:42 'Stefan Weil' via tesseract-dev <tesser...@googlegroups.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-dev/252b8d09-980f-43e6-bfab-23b0364e66c4%40googlegroups.com.

Stefan Weil

unread,
Oct 7, 2019, 3:22:57 PM10/7/19
to tesseract-dev
The current code uses `ASSERT_HOST`, ÀSSERT_HOST_MSG` and `assert`, but not `ASSERT`. Only `assert` is disabled in release builds (I think this is fine).

Zdenko Podobny

unread,
Oct 14, 2019, 5:19:18 PM10/14/19
to tesser...@googlegroups.com

ne 6. 10. 2019 o 17:56 Zdenko Podobny <zde...@gmail.com> napísal(a):

Stefan Weil

unread,
Oct 15, 2019, 1:53:00 AM10/15/19
to tesseract-dev
I started a new section in the Wiki (Planning), so we can collect all ideas and suggestions there.

Stefan
Reply all
Reply to author
Forward
0 new messages