Commit a8d3da31 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

removed additional newline in error messages and added fflush for stdout

parent 713e8487
......@@ -23,7 +23,7 @@
// Debug Switches
extern int cdoDebug;
extern int cdoDebugExt; // Debug level for the KNMI extensions
// Subsystem Debug Switches
// Subsystem Debug Switches
extern int PSTREAM;
extern int PROCESS;
extern int PIPE;
......@@ -44,13 +44,14 @@ void setExitFunction(void (*func)(void));
void setContextFunction(const char *(*func)(void) );
} // namespace CdoOut
void cdiOpenError(int cdiErrno, const std::string &format , const char *path);
void cdiOpenError(int cdiErrno, const std::string &format, const char *path);
template <typename... Args>
void
cdoAbort(const std::string &format, Args const &... args) noexcept
{
MpMO::PrintCerr(Red("%s (Abort): ") + Black(format) +"\n" , CdoOut::getContext(), args...);
fflush(stdout);
MpMO::PrintCerr(Red("%s (Abort): ") + Black(format), CdoOut::getContext(), args...);
if (MpMO::exitOnError)
{
CdoOut::exitProgram();
......@@ -60,8 +61,7 @@ template <typename... Args>
void
cdoPrint(const std::string &format, Args const &... args) noexcept
{
if (!MpMO::silentMode)
MpMO::PrintCerr(Green("%s: ") + Black(format) , CdoOut::getContext(), args...);
if (!MpMO::silentMode) MpMO::PrintCerr(Green("%s: ") + Black(format), CdoOut::getContext(), args...);
}
#ifdef WITH_CALLER_NAME
#define cdoSysError(...) MpMO::SysError_(__func__, __VA_ARGS__)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment