Error logging almost working!
This commit is contained in:
@@ -12,5 +12,13 @@ if (NB_BUILD_TESTS)
|
||||
NBCore
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_executable(LoggerTest
|
||||
./testLogger.cpp
|
||||
)
|
||||
target_link_libraries(LoggerTest
|
||||
NBCore
|
||||
)
|
||||
|
||||
gtest_discover_tests(TestCore)
|
||||
endif()
|
||||
@@ -0,0 +1,17 @@
|
||||
#include <exception>
|
||||
|
||||
#include "Errors.hpp"
|
||||
#include "Logger.hpp"
|
||||
|
||||
|
||||
|
||||
int main() {
|
||||
nb::logger.log("Whoop!");
|
||||
try {
|
||||
THROW(nb::Error, "Hiii!");
|
||||
} catch (nb::Error<nb::NoneType> e){
|
||||
nb::logger.log("Winner winner chicken dinner!");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user