Created
October 27, 2021 20:15
-
-
Save marcusmueller/b4f454a2327fb6e35aad1690977c280b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <spdlog/sinks/stdout_color_sinks.h> | |
#include <spdlog/spdlog.h> | |
#include <memory> | |
#ifdef DONT | |
#define LVL trace | |
#else | |
#define LVL warn | |
#endif | |
void test_log(std::shared_ptr<spdlog::logger> logger, unsigned int number_of_spiders) | |
{ | |
for (; number_of_spiders; --number_of_spiders) | |
logger->LVL("Oh noes! There's {:d} spiders in my house!", number_of_spiders); | |
} | |
int main(int argc, char** argv) | |
{ | |
auto logger = spdlog::stdout_color_st("logme"); | |
test_log(logger, std::stoi(argv[1])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment