From 90ff3d0256327bd4097568740a0ece24ca722989 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 28 Feb 2021 21:44:33 +0100 Subject: nxcomp/Children.cpp: add macro checks around some log/stderr prints This helps no flooding the output with (double) messages. --- nxcomp/src/Children.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp index 40eccd9da..842db7fe5 100644 --- a/nxcomp/src/Children.cpp +++ b/nxcomp/src/Children.cpp @@ -257,15 +257,17 @@ int NXTransDialog(const char *caption, const char *message, } } - #ifdef WARNING + #ifdef TEST *logofs << "NXTransDialog: WARNING! Couldn't start '" << command << "'. " << "Error is " << EGET() << " '" << ESTR() << "'.\n" << logofs_flush; #endif + #ifdef WARNING cerr << "Warning" << ": Couldn't start '" << command << "'. Error is " << EGET() << " '" << ESTR() << "'.\n"; + #endif // // Retry by looking for the default name @@ -302,13 +304,15 @@ int NXTransDialog(const char *caption, const char *message, // FIXME: check if strncat would be better here snprintf(newPath + newLength, DEFAULT_STRING_LIMIT - newLength, "%s", oldPath); - #ifdef WARNING + #ifdef TEST *logofs << "NXTransDialog: WARNING! Trying with path '" << newPath << "'.\n" << logofs_flush; #endif + #ifdef WARNING cerr << "Warning" << ": Trying with path '" << newPath << "'.\n"; + #endif // // Solaris doesn't seem to have -- cgit v1.2.3