Questions tagged [spdlog]

Very fast, header only, C++ logging library.

GitHub Project

Very fast, header only, C++ logging library.

118 questions
2
votes
1 answer

conan + cmake generators : include directories not found during compilation

I am new to Conan, and I'm struggling to use specific conan packages in CMake. I started with including boost to my project using conan, and that worked out great out-of-the-box. the project compiled and linked successfully from the start. I then…
lagarkane
  • 915
  • 2
  • 9
  • 22
2
votes
1 answer

Is it possible to configure spdlog from a file like log4j or log4cxx?

I have experience of log4j, and have used a port of it called log4net in c#. In both cases I find it very useful to configure loggers at run time, by means of logger config files. For example you can increase the log level of a particular subsystem…
Paulus
  • 1,385
  • 16
  • 20
2
votes
1 answer

Library compile time settings mismatch when linking spdlog from conan using CMake/VS2019?

I'm trying to add spdlog 1.9.0 to my CMake project, and for this project I'm using VS2019's new CMake-based project system for building/running it. When I include spdlog in my implementation using a very simple invocation, I get a linker error when…
Brad Heller
  • 95
  • 1
  • 6
2
votes
2 answers

How can I read spdlog output in a google test

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 :…
mike
  • 1,192
  • 9
  • 32
2
votes
1 answer

In custom reverse vector iterator don't see first element

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…
2
votes
0 answers

Relatively low performance of spdlog when using asynchronous loggers with benchmarks

I am an inexperienced developer and noticed that spdlog allows instantiating the multi-threaded loggers using the spdlog::async_factory as the first template parameter. auto basic_async_mt = spdlog::basic_logger_mt("basic_mt",…
Araeos
  • 171
  • 2
  • 9
2
votes
2 answers

How do I expose a library's enum, such that my code doesn't have to type out the entire namespace to use that enum?

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…
Max
  • 808
  • 11
  • 25
2
votes
1 answer

spdlog: failing to flush/write to file

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",…
Mike Sadler
  • 1,750
  • 1
  • 20
  • 37
2
votes
1 answer

spdlog error: "don't know how to format the type, include fmt/ostream.h if it provides an operator<< that should be used"

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 …
Mike Sadler
  • 1,750
  • 1
  • 20
  • 37
2
votes
2 answers

spdlog.h isn't found in CMake project

I am trying to integrate spdlog, a header only logging library into a C++ project but I am having trouble getting CMake to recognise the include paths properly. I am using the latest CLion with CMake 3.10.2 on Ubuntu 18.04. My project structure…
TokenGuard
  • 29
  • 2
  • 5
2
votes
2 answers

Spdlog logger with gtest framework is not working

I am using spdlog and gtest in my library. I need to save some logs (not gtest logs) from test execution to files. Here is code for creating loggers: void createLogger() { auto debug_logger = spdlog::rotating_logger_mt("debug_logger",…
wpater
  • 393
  • 3
  • 14
2
votes
1 answer

How to log pid(process id) by using spdlog

spdlog can log threadid by doing: spdlog::set_pattern("*** [%H:%M:%S %z] [thread %t] %v ***"); But how can I log the pid(process id)?
swtybb
  • 31
  • 5
2
votes
1 answer

How to change the default rolling time in spdlog daily logger?

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");
Ofiris
  • 6,047
  • 6
  • 35
  • 58
1
vote
0 answers

spdlog & fmt version conflict

Learning Conan right now, I am trying to rewrite part of my CMake files to use conan instead of other package managers like CPM and the CMake built-in FetchContent_Declare function. Among other packages, I am using the followings with corresponding…
Ramin Toussi
  • 97
  • 1
  • 11
1
vote
0 answers

lsplog library not found when linking the project with spdlog

i am trying to add logging to my project using spdlog but the problem is when compiling the project in the linking stage i get this error "[ 72%] Linking CXX executable ${project} /usr/bin/ld: cannot find -lsplog: No such file or dir collect2:…