Cantera  2.0
Classes | Functions
Writing messages to the screen
Diagnostic Output
Collaboration diagram for Writing messages to the screen:

Classes

class  Application
 Class to hold global data. More...
 
class  Logger
 Base class for 'loggers' that write text messages to log files. More...
 

Functions

void writelog (const std::string &msg)
 Write a message to the screen.
 
void writelog (const char *pszmsg)
 Write a message to the screen.
 
void setLogger (Logger *logwriter)
 Install a logger.
 
void writelog (const std::string &msg)
 Write a message to the screen.
 
void writelogendl ()
 Write an endl to the screen and flush output.
 
void writelog (const char *pszmsg)
 Write a message to the screen.
 
void setLogger (Logger *logwriter)
 Install a logger - Called by the language interfaces to install an appropriate logger.
 
void writelog (const std::string &msg)
 Write a message to the screen.
 
void writelog (const char *msg)
 Write a message to the screen.
 
void writelogf (const char *fmt,...)
 Write a formatted message to the screen.
 
void error (const std::string &msg)
 Write an error message and terminate execution.
 
int userInterface ()
 returns 1 for MATLAB, 2 for Python, and 0 for C++ or Fortran.
 
void setLogger (Logger *logwriter)
 Install a logger.
 

Detailed Description

Function Documentation

void writelog ( const std::string &  msg)

Write a message to the screen.

The string may be of any length, and may contain end-of-line characters. This method is used throughout Cantera to write log messages.

Parameters
msgc++ string to be written to the screen

Definition at line 155 of file application.cpp.

Referenced by Application::writelog().

void writelog ( const char *  pszmsg)

Write a message to the screen.

The string may be of any length, and may contain end-of-line characters. This method is used throughout Cantera to write log messages.

Parameters
pszmsgc character string to be written to the screen

Definition at line 149 of file application.cpp.

void setLogger ( Logger logwriter)

Install a logger.

Called by the language interfaces to install an appropriate logger. The logger is used for the writelog() function

Parameters
logwriterPointer to a logger object
See Also
Logger.

Definition at line 124 of file application.cpp.

Referenced by Application::setLogger().

void writelog ( const std::string &  msg)
inline

Write a message to the screen.

The string may be of any length, and may contain end-of-line characters. This method is used throughout Cantera to write log messages.

Parameters
msgc++ string to be written to the screen

Definition at line 509 of file application.h.

References Application::pMessenger, and Application::Messages::writelog().

Referenced by Application::Messages::endLogGroup(), Application::get_XML_File(), Application::Messages::logErrors(), Application::Messages::write_logfile(), and Cantera::writelog().

void writelogendl ( )
inline

Write an endl to the screen and flush output.

Definition at line 518 of file application.h.

References Application::pMessenger, and Application::Messages::writelogendl().

Referenced by Cantera::writelogendl().

void writelog ( const char *  pszmsg)
inline

Write a message to the screen.

The string may be of any length, and may contain end-of-line characters. This method is used throughout Cantera to write log messages.

Parameters
pszmsgc null terminated string to be written to the screen

Definition at line 531 of file application.h.

References Application::pMessenger, and Application::Messages::writelog().

void setLogger ( Logger logwriter)
inline

Install a logger - Called by the language interfaces to install an appropriate logger.

Parameters
logwriterPointer to a logger object
See Also
Logger.

Definition at line 565 of file application.h.

References Application::pMessenger, and Application::Messages::setLogger().

Referenced by Cantera::setLogger().

void writelog ( const std::string &  msg)

Write a message to the screen.

The string may be of any length, and may contain end-of-line characters. This method is used throughout Cantera to write log messages. It can also be called by user programs. The advantage of using writelog over writing directly to the standard output is that messages written with writelog will display correctly even when Cantera is used from MATLAB or other application that do not have a standard output stream.

This routine is part of the interface suite whose behavior changes with the interface. The interface suite has been moved to the class logger and inherited classes of logger.

Parameters
msgString message to be written to the screen

Definition at line 33 of file global.cpp.

References Cantera::app(), and Application::writelog().

Referenced by Bdry1D::_getInitialSoln(), InterfaceKinetics::applyButlerVolmerCorrection(), Cantera::bound_step(), NasaThermo::checkContinuity(), ctml::ct2ctml(), MultiNewton::dampStep(), Cantera::deprecatedMethod(), ChemEquil::equilibrate(), ChemEquil::equilResidual(), ChemEquil::estimateElementPotentials(), ChemEquil::estimateEP_Brinkley(), ctml::get_CTML_Tree(), ctml::getFloatArray(), ctml::getFloatCurrent(), ctml::getFloats(), ctml::getInteger(), ChemEquil::initialize(), PureFluidPhase::initThermo(), SimpleThermo::install(), NasaThermo::install(), ShomateThermo::install(), LogPrintCtrl::pr_de(), LogPrintCtrl::pr_de_c10(), Sim1D::refine(), Cantera::removeAtVersion(), Sim1D::restore(), ChemEquil::setInitialMoles(), Inlet1D::showSolution(), StFlow::showSolution(), Surf1D::showSolution(), ReactingSurf1D::showSolution(), Domain1D::showSolution(), MultiNewton::solve(), RootFind::solve(), OneDim::timeStep(), UnknownThermoParam::UnknownThermoParam(), Cantera::writelogf(), and OneDim::writeStats().

void writelog ( const char *  msg)

Write a message to the screen.

The string may be of any length, and may contain end-of-line characters. This method is used throughout Cantera to write log messages.

This routine is part of the interface suite whose behavior changes with the interface. The interface suite has been moved to the class logger and inherited classes of logger.

Parameters
msgc character string to be written to the screen

Definition at line 38 of file global.cpp.

References Cantera::app(), and Application::writelog().

void writelogf ( const char *  fmt,
  ... 
)

Write a formatted message to the screen.

Using the printf formatting of C, write a message to the screen with variable values.

Here, we format an internal string with the correct values and then feed it into writelog().

Parameters
fmtc format string for the following arguments

Definition at line 43 of file global.cpp.

References Cantera::writelog().

Referenced by ChemEquil::equilibrate(), ChemEquil::equilResidual(), ChemEquil::estimateElementPotentials(), ChemEquil::estimateEP_Brinkley(), SquareMatrix::factor(), SquareMatrix::factorQR(), ctml::get_CTML_Tree(), Cantera::invert(), mlequ(), SquareMatrix::rcond(), BandMatrix::rcond(), SquareMatrix::rcondQR(), ChemEquil::setInitialMoles(), SquareMatrix::solve(), Cantera::solve(), RootFind::solve(), and SquareMatrix::solveQR().

void error ( const std::string &  msg)

Write an error message and terminate execution.

This routine is part of the interface suite whose behavior changes with the interface. The interface suite has been moved to the class logger and inherited classes of logger.

Parameters
msgError message to be written to the screen.

Definition at line 66 of file global.cpp.

References Cantera::app(), and Application::logerror().

Referenced by NonlinearSolver::calcSolnToResNormVector(), NonlinearSolver::print_solnDelta_norm_contrib(), NonlinearSolver::residErrorNorm(), BEulerInt::soln_error_norm(), NonlinearSolver::solnErrorNorm(), and BEulerInt::time_error_norm().

int userInterface ( )

returns 1 for MATLAB, 2 for Python, and 0 for C++ or Fortran.

This routine is part of the interface suite whose behavior changes with the interface. The interface suite has been moved to the class logger and inherited classes of logger.

Deprecated:

Definition at line 71 of file global.cpp.

References Cantera::app(), and Application::getUserEnv().

void setLogger ( Logger *  logwriter)

Install a logger.

Called by the language interfaces to install an appropriate logger. The logger is used for the writelog() function

Parameters
logwriterPointer to a logger object
See Also
Logger.

Definition at line 24 of file global.cpp.

References Cantera::app(), Logger::error(), and Application::setLogger().