-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
The C++ Programmer's Mindset
By :
Logging is important for us to see what a program is doing during execution. There are several options for when, how, and where to log the information about what your program is doing, but generally, one either logs directly to the console (as we will do here) or logs to a file. Some operating systems, such as Linux, also provide a system logging facility, but since this is not universal, we won’t use that here. Most logging frameworks provide filters based on severity to decide which messages actually make it to the log. High-severity messages such as errors and warnings are generally allowed through to the log in all but the most conservative settings, while general information, debug information, and very fine-grained trace information are usually filtered out.
As shown in the CMakeLists.txt file and in the includes listed in the previous section, we’re using the spdlog library to implement logging in the duckies program. This is a header-only...