FCF 2.0 development in progress...
> > > > > >
[News] [C++ Libraries API] [C++ Downloads] [Donate to the project] [Contacts]

setLevel() method from fcf::NTest::Logger class

void setLevel(fcf::NTest::ELogLevel a_level)

Class: fcf::NTest::Logger

Package: fcfTest

File: test.hpp

Available from version: 1.0.1

Sets the current logging threshold level, determining the minimum severity required for a message to be processed

The setLevel method updates the logger's verbosity threshold. Once set, the logger will only output messages with a severity level equal to or higher than the specified ELogLevel.

Note: LL_DEF cannot be used as a primary value and will throw a std::runtime_error

Arguments

fcf::NTest::ELogLevel a_level
- The desired ELogLevel threshold. Note: LL_DEF cannot be used as a primary value and will throw a std::runtime_error

Example: Runtime Level Adjustment

// Set logger to only show errors and fatal messages fcf::NTest::logger().setLevel(fcf::NTest::LL_ERR); fcf::NTest::err() << "This will be printed." << std::endl; fcf::NTest::inf() << "This will be ignored." << std::endl;