LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
LehrFEM++ can give you additional debug output in two ways:
PrintInfo()
method to output e.g. information about a mesh to std::cout
, ormesh::MeshFactory::Build()
).PrintInfo()
methodsThere are a number of member/free PrintInfo()
functions which accept
std::ostream
(such as std::cout
),int ctrl
argument that specifies the level of detail (0 = only the absolutely necessary information, 100 = highest level of detail).For example, if we want to print information about a mesh::Mesh to standard output, we could write:
LehrFEM++ uses the excellent spdlog library to output additional (debug) information. spdlog introduces the class spdlog::logger
with which LehrFEM++ logs data to one or more "sinks" (such as std::cout
or a file). There are six log levels which are used as follows in LehrFEM++:
level | description |
---|---|
Critical | Coarsest level, is used for logging additional information just before the program aborts. (e.g. before an assert fails) |
Error | For logging information related to a recoverable error. E.g. when an exception is thrown. |
Warn | Warn the user when something may not work as expected. |
Info | Inform the user about something important. |
Debug | Additional information that helps in debugging a problem. |
Trace | Even more extensive information for debugging a problem. |
By default all loggers in LehrFEM++ are initialized such that they
spdlog::stdout_color_mt
) which writes to std::cout,Virtually 99% of the logging statements in LehrFEM++ have log level Debug or Trace. Therefore, LehrFEM++ will by default not output anything to the standard output. If you want to show these log statements, you have to change the log level of the associated loggers.
In LehrFEM++ every class or free function, which wants to log something, decalares a spdlog::logger
.
If you want to see Debug log message of AssembleMatrixLocally you can just write
Or if you want to see all log messages (level Trace or higher) of the class hybrid2d::Mesh:
Change the log level for all registered logggers in the registry to Debug (not recommended):
The example examples/loggers/mesh_hierarchy_demo.cc
shows how one can set the log levels of individual loggers via command-line and environment variables and some other advanced techniques.
Please check the contribution guide.