Added debug macros

This commit is contained in:
gabi
2014-12-18 10:07:21 +02:00
parent 3e51669951
commit 348390f90d
6 changed files with 107 additions and 68 deletions

View File

@@ -69,14 +69,15 @@ int main(int, char* [])
spd::get("console")->info("loggers can be retrieved from a global registry using the spdlog::get(logger_name) function");
SPDLOG_TRACE(file_logger, "This is a trace message (only #ifdef _DEBUG)", 123);
SPDLOG_TRACE(console, "Trace message - enabled only #ifdef SPDLOG_TRACE_ON..{} ,{}", 1, 3.23);
SPDLOG_DEBUG(console, "Debug message - enabled only #ifdef SPDLOG_DEBUG_ON.. {} ,{}", 1, 3.23);
//
// Asynchronous logging is easy..
// Just call spdlog::set_async_mode(q_size) and all created loggers from now on will be asynchronous..
// Note: queue size must be power of 2!
//
size_t max_q_size = 1048576;
size_t max_q_size = 1048576;
spdlog::set_async_mode(max_q_size);
auto async_file= spd::daily_logger_st("async_file_logger", "logs/async_log.txt");
async_file->info() << "This is async log.." << "Should be very fast!";