Skip to content

Commit

Permalink
Move default success messages from stdout to LOG_SUCCESS
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber authored and OpenModelica-Hudson committed Nov 6, 2017
1 parent 691f4e9 commit bb335c6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions SimulationRuntime/c/simulation/simulation_runtime.cpp
Expand Up @@ -126,6 +126,7 @@ void setGlobalVerboseLevel(int argc, char**argv)
/* default activated */
useStream[LOG_STDOUT] = 1;
useStream[LOG_ASSERT] = 1;
useStream[LOG_SUCCESS] = 1;
return; // no lv flag given.
}

Expand Down Expand Up @@ -161,6 +162,11 @@ void setGlobalVerboseLevel(int argc, char**argv)
useStream[i] = 1;
error = 0;
}
else if(flag == string("-") + string(LOG_STREAM_NAME[i]))
{
useStream[i] = 0;
error = 0;
}
}

if(error)
Expand Down
Expand Up @@ -310,7 +310,7 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
retVal = data->callback->functionRemovedInitialEquations(data, threadData);

if (!retVal)
infoStreamPrint(LOG_STDOUT, 0, "The initialization finished successfully %s homotopy method.", data->simulationInfo->homotopyUsed ? "with" : "without");
infoStreamPrint(LOG_SUCCESS, 0, "The initialization finished successfully %s homotopy method.", data->simulationInfo->homotopyUsed ? "with" : "without");

TRACE_POP
return retVal;
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/solver/solver_main.c
Expand Up @@ -791,7 +791,7 @@ int solver_main(DATA* data, threadData_t *threadData, const char* init_initMetho
}

if (!retVal)
infoStreamPrint(LOG_STDOUT, 0, "The simulation finished successfully.");
infoStreamPrint(LOG_SUCCESS, 0, "The simulation finished successfully.");

TRACE_POP
return retVal;
Expand Down
3 changes: 3 additions & 0 deletions SimulationRuntime/c/util/omc_error.c
Expand Up @@ -75,6 +75,7 @@ const char *LOG_STREAM_NAME[SIM_LOG_MAX] = {
"LOG_SOTI",
"LOG_STATS",
"LOG_STATS_V",
"LOG_SUCCESS",
#ifdef USE_DEBUG_TRACE
"LOG_TRACE",
#endif
Expand Down Expand Up @@ -121,6 +122,7 @@ const char *LOG_STREAM_DESC[SIM_LOG_MAX] = {
"final solution of the initialization", /* LOG_SOTI */
"additional statistics about timer/events/solver", /* LOG_STATS */
"additional statistics for LOG_STATS", /* LOG_STATS_V */
"this stream is always active, unless deactivated with -lv=-LOG_SUCCESS", /* LOG_SUCCESS */
#ifdef USE_DEBUG_TRACE
"enables additional output to trace call stack", /* LOG_TRACE */
#endif
Expand Down Expand Up @@ -161,6 +163,7 @@ void initDumpSystem()

useStream[LOG_STDOUT] = 1;
useStream[LOG_ASSERT] = 1;
useStream[LOG_SUCCESS] = 1;
}

void printInfo(FILE *stream, FILE_INFO info)
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/util/omc_error.h
Expand Up @@ -113,6 +113,7 @@ enum LOG_STREAM
LOG_SOTI,
LOG_STATS,
LOG_STATS_V,
LOG_SUCCESS,
#ifdef USE_DEBUG_TRACE
LOG_TRACE,
#endif
Expand Down

0 comments on commit bb335c6

Please sign in to comment.