I have a simple project which requires three header-only libraries in order to compile: websocketpp, spdlog and nlohmann/json.
The project structure looks like this:
└── src
├── app
│ ├── CMakeLists.txt
│ ├── src
│ └── test
…
I am trying to use spdlog in a project involving a library under windows.
I create two loggers. One for the app using the library, one for the library itself.
The library's logger is created from the app but when the library want to add a message,…
I am creating c++ library modules in my application. To do logging, I use spdlog. But in a production environment, I don't want my lib modules to do any logging. One way to achieve turning on/off would be to litter my code with #ifdef…
I'm working on a C++ project that uses two different libraries: spdlog for logging, and mutils-serialization for serializing objects to bytes (for sending over the network). Both libraries use namespaces properly, but when I attempt to write a…
I recently switched from Boost Log to Spdlog for the purported speed advantages.
However, when I compared the runtimes before and after the switch, I'm finding that Boost Log is significantly faster. I'm wondering if I'm doing something wrong with…
I want to declare identifiers for scopes which will be used to automatically populate a field of any logging statements within the innermost scope. They will usually, but not always (e.g. lambdas, blocks introduced with {}), match the "name" of the…
I want to include spdlog into one of my project. It is a header only library. The project that i am building is using cmake. Currently i am using
include_directories('src/logger/spdlog/')
in cmake and including the library as
#include…
The other day I wanted to try writing my own iterators for a vector, of course, the most primitive example, since there is a lot of confusing code in the c++ standards. So the usual iterator for a vector in the forward direction works fine, but…
I am trying to use spdlog. I incorporated it with my code, but now I am getting the following error:
....fmt\core.h(1016): error C2338: Cannot format argument. To make type T formattable provide a formatter specialization:…
I'm using a library called spdlog for logging. I'd like to build my own Logger around the library so that I have the option of adding 'extra' functionality that's specific to my application.
I was able to get this code below working:
#include…
I feel like a fool asking this, as it is about as trivial example as I can think of, but it's holding me up.
I've implemented a very basic console-and-file logger:
auto logger = spdlog::basic_logger_mt("console and file logger",…
I've just picked up spdlog in an effort to improve our logging. Our logging is very basic, so I'm just copying the "multi sink" example almost verbatim to log to file and console.
However, even when following the example exactly, I get:
Error …
Using spdlog, how can I change the default rolling time of the daily logger?
In the following example, the rolling happens only at midnight:
auto logger = spd::daily_logger_st("my_logger", "fl_log.txt");
I am on the latest commit of spdlog (there is an issue regarding std output, apparently resolved), and am switching my output from std::cout to spdlog.
My google tests redirect std::cout so I can check the output of stub functions:
class MyTest :…