From 868c0cedb0dd6ceba48939329d99e77f26f22c3f Mon Sep 17 00:00:00 2001 From: Asit Kumar Dhal Date: Sat, 17 Jun 2017 20:26:07 +0200 Subject: [PATCH] Update README file --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 6c39596d..4ceaa304 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Very fast, header only, C++ logging library. [![Build Status](https://travis-ci. * Feature rich [call style](#usage-example) using the excellent [fmt](https://github.com/fmtlib/fmt) library. * Extremely fast asynchronous mode (optional) - using lockfree queues and other tricks to reach millions of calls/sec. * [Custom](https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) formatting. +* Conditional Logging * Multi/Single threaded loggers. * Various log targets: * Rotating log files. @@ -91,6 +92,12 @@ int main(int, char*[]) console->info("Welcome to spdlog!"); console->error("Some error message with arg{}..", 1); + // Conditional logging example + auto i = 2; + console->info_if(i < 20, "Welcome to spdlog conditional logging!"); + console->warn_if(i != 0, "an important message"); + console->critical_if(i != 2, "a false warning which won't show up"); + // Formatting examples console->warn("Easy padding in numbers like {:08d}", 12); console->critical("Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42);