Logging functionality for Pressio repositories
This is a work in progress, and all subsequent information is subject to change.
- Clone the repo
git clone https://github.com/Pressio/pressio-log.git
- Set logging level in CMake and build tests
cd pressio-log
mkdir build
cd build
cmake -D PRESSIO_LOG_LEVEL=DEBUG .. && make
All logging levels:
- 0 - "None"
- 1 - "Basic"
- 2 - "Info"
- 3 - "Debug"
You can pass either the number or the corresponding string as the argument.
- Include the library
Point to pressio-log/include
to include the relevant files.
- Include the core file
#include <pressio-log/core.hpp>
- Use the library
All logging is handled via macros:
PRESSIOLOG_BASIC("message");
PRESSIOLOG_INFO("message");
PRESSIOLOG_DEBUG("message");
PRESSIOLOG_WARNING("message");
PRESSIOLOG_ERROR("message");
Errors will print regardless of the logging level. Warnings will print for any level above "none".
After you have built (see step 2), run:
cd pressio-log/build/tests/logging
ctest