#include <cstdio>
#include <cstdarg>
#include "params.h"
#include <tesseract/strngs.h>
#include "tprintf.h"
Go to the source code of this file.
◆ MAX_MSG_LEN
◆ tprintf()
DLLSYM void tprintf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Definition at line 34 of file tprintf.cpp.
37 const char* debug_file_name = debug_file.c_str();
38 static FILE *debugfp =
nullptr;
40 if (debug_file_name ==
nullptr) {
47 if (strcmp(debug_file_name,
"/dev/null") == 0) {
48 debug_file_name =
"nul";
49 debug_file.set_value(debug_file_name);
53 if (debugfp ==
nullptr && debug_file_name[0] !=
'\0') {
54 debugfp = fopen(debug_file_name,
"wb");
55 }
else if (debugfp !=
nullptr && debug_file_name[0] ==
'\0') {
61 va_start(args, format);
62 if (debugfp !=
nullptr) {
63 vfprintf(debugfp, format, args);
65 vfprintf(stderr, format, args);