What I have here is a modified tesseract where all feedback\reporting like this still goes through tprintf() -- hence a single log channel for all -- but the entire codebase is checked to ensure that all error lines are prefixed with
ERROR:
while warning messages are prefixed with
WARNING:
and the rest is kept as-is (the 'info' and 'debug' level messages).
Rationale?
1: single channel is easiest to collect and redirect \ store \ hook (think applications where stderr and stdout don't exist or are not obvious, e.g. Win32 \ GUIs where you want to see such stuff in a panel or elsewhere, no console window wanted\needed). tprintf() is modified to call a userdef callback which does the actual write(stderr) or whatever you like\need.
2: I like cli apps which use stderr for all feedback\reporting so stdout is free to be used as data output channel. Think apps that can --output=[file] or --output=- to indicate stdout as the channel where generated\processed data is written, which is handy when you want to use it with pipes. This as a general concept, not specific to training tools, which probably won't need this, but "general expectations the same everywhere" sort of thing.
3. For all processes, ocr, training, or otherwise, the tprintf() \ printf() stuff in the code is all 'side channel' to me. Meaning: the process itself, whatever it is, works stdin \ file-in to stdout \ file-out, while any reporting, diagnostics, anything-not-the-primary-product, is 'side channel', hence stderr.
I consider tesseract rather more a library \ back end application set than a user-facing front-end app. I do realize nobody has done it (yet?), certainly not for *training* tesseract, but I'd like someone to at least be able to to integrate tesseract into their product, so current tprintf + stderr is my preference for this (supposed) context. (I'm biased as I would like to use tesseract that way myself one day ;-) )
4. Having a single "log channel" with *unique* "ERROR: " and "WARNING: " line\message prefixes for those makes it very simple for anyone\any software down the line to filter \postprocess those messages for user\specific purposes. (And, of course, "quiet output" is achieved by ditching everything without those specific prefixes ;-) )
My 2 cents, HTH. :-)
Cheers,
Ger