AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::slic::SimpleLogger Class Reference

SimpleLogger is a simple wrapper around the initialization and finalize operations of the slic::Logger class that is helpful for unit tests and simple applications in axom. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/slic/core/SimpleLogger.hpp>

Public Member Functions

 SimpleLogger (message::Level level=message::Debug)
 Constructor initializes slic logging environment. More...
 
 ~SimpleLogger ()
 Destructor finalizes slic loging environment. More...
 

Detailed Description

SimpleLogger is a simple wrapper around the initialization and finalize operations of the slic::Logger class that is helpful for unit tests and simple applications in axom.

To use, create an instance of this class before tests are run. This initializes the slic logger. When the object is destroyed (e.g., goes out of scope), the slic logger is finalized. For example, when using gtest, a simple main program can be used in each test source file to do this:

*
*  int main(int argc, char* argv[])
*  {
*     int result = 0;
*
*     ::testing::InitGoogleTest(&argc, argv);
*
*     // create & initialize test logger, finalized when exiting main scope
*     axom::slic::SimpleLogger logger;
*
*     result = RUN_ALL_TESTS();
*
*     return 0;
*  }
*
* 

Constructor & Destructor Documentation

◆ SimpleLogger()

axom::slic::SimpleLogger::SimpleLogger ( message::Level  level = message::Debug)
inlineexplicit

◆ ~SimpleLogger()

axom::slic::SimpleLogger::~SimpleLogger ( )
inline

Destructor finalizes slic loging environment.

References axom::slic::finalize(), axom::slic::flushStreams(), and axom::slic::isInitialized().


The documentation for this class was generated from the following file: