Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow-up to dev mailing list discuss + issue #3998: RFC: Consistent tprintf() use, ERROR: & WARNING: prefixes. #4020

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Feb 25, 2023

  1. follow-up to dev mailing list discuss + issue: RFC: Info messages to …

    …stdout from training utils (Issue tesseract-ocr#3998)
    
    Here's the extract/backport from my master branch:
    
    - use tprintf() for all error/warning/info/debug-diagnostics output --> fprintf(stderr, msg) --> tprintf(msg). This also anticipates migrating tesseract to using the fmt library (C++20) as done by @stweil in a dev branch.
    - all error messages are prefixed with 'ERROR: '. This enables users, f.e., to grep/filter the stderr/log using a regex like '/^EERROR: /' to filter out the error messages. Application code which overrides the tprintf() API is another example: there error messages can be easily picked up and sent to different monitor channels / GUI windows / etc. in environments where there's no stdout/stderr (MSWindows GUI) or where end users are not accustomed to watching stdout/stderr.
    - ditto for 'WARNING: ' level messages.
    
    CAVEAT: this is a manual transfer from my master branch + code review whilee I was at it. I hope I got them all... :-)
    GerHobbelt committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    5263cab View commit details
    Browse the repository at this point in the history
  2. Whoops! one of the fmt format lines got through. My mistake! Sigh. Of…

    … course, one only sees it when scrolling through the pullreq after the fact.
    GerHobbelt committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    ccae24f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    99e35c6 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2023

  1. Configuration menu
    Copy the full SHA
    9791350 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5d708fa View commit details
    Browse the repository at this point in the history
  3. fix QA error due to std::string arg used in tprintf, where C string i…

    …s expected. Cause: omission in backporting this from tprintf+fmt code. Caught by CI.
    GerHobbelt committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    390b6e8 View commit details
    Browse the repository at this point in the history