Questions tagged [spdlog]

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

GitHub Project

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

63 questions
0
votes
1 answer

spdlog custom log tags

I would like to add some extra data to my log output depending on where it was logged. For instance I might have System A and System B, both spitting out log data, but perhaps I'm only interested in System B's log lines now so I could filter based…
0
votes
1 answer

Why can't I link to spdlog library installed with conan

I have a simple CMake project and try to use the spdlog library (version 1.5.0) installed by conan. But when building I get the following error: undefined reference to `spdlog::get(std::__cxx11::basic_string,…
samoncode
  • 321
  • 2
  • 5
  • 18
0
votes
1 answer

Grabbing printed statements from console C++

I have two loggers in my program. One that I made inside a gui, and one that is super complicated but very well designed and prints to the console. I am trying to get the output from the nice console logger to the rendered one. I have tried…
Yea okay
  • 121
  • 6
0
votes
1 answer

Extend spdlog for custom type

Is there a way to extend spdlog to support a custom struct as an item when formatting using {}? So when I have a struct p { int x; int y; int z; }; p my_p; I want to do spdlog::info("p = {}", my_p); // after registering some kind of…
pmf
  • 7,238
  • 4
  • 43
  • 68
0
votes
2 answers

How to escape spdlog message?

I'm using spdlog to log all messages. My log pattern is a JSON format. I'm escaping messages manually in all log calls. Is there any way exists to escape messages automatically in spdlog layer? Sample of manually…
mortymacs
  • 2,657
  • 2
  • 22
  • 42
0
votes
1 answer

Spdlog doesn't add to a file

I want to configure the logger in another file, but when I do this, the logger doesn't add anything to this file. Why? For simplicity I got the following example from the library documentation(the function body). *.cpp namespace logger { void…
nnuttertools
  • 101
  • 7
0
votes
1 answer

Why msvc can't find "spdlog/spdlog.h" header?

Code Repository: https://github.com/fastype/fastype This project use build.bat initialize on Windows 10 with Visual Studio 2017. It will clone the github repositories and build third party dependencies, then create visual studio sln project file via…
linrongbin
  • 1,886
  • 3
  • 19
  • 33
0
votes
1 answer

Why spdlog/pthread include directory is empty via pkg_search_module in CMake on macos?

Environment OS: macos package manager: homebrew build tool: cmake, pkg-config, clang repository: https://github.com/xedit/xedit they're all newest version. CMakeLists.txt the CMakeLists.txt are: project(xeditd LANGUAGES CXX VERSION…
linrongbin
  • 1,886
  • 3
  • 19
  • 33
0
votes
1 answer

Spdlog v1.3.1 examples of async logger are giving error in ubuntu 18.04

I have installed spdlog manually from git repo having version 1.3.1 in version.h . Now i am trying to execute basic examples given in the repository but they are giving certain errors. Synchronous loggers example are running fine though. I have…
nishu jain
  • 11
  • 5
0
votes
1 answer

spdlog logging a single wchar_t string containing data which inculdes {...}

I am using spdlog with a registry application. I am getting an exception when attempting to log a single wchar_t string containing a reprentation of a CLSID, say "{0C092C21-882C-11CF-A6BB-080C7B2D682}". I understand that in spdlog "{}" is a…
0
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
  • 11
  • 1
  • 5
0
votes
1 answer

Installing spdlog by copying contents of include directory

I'm trying to use spdlog as a logging library, but I do not want to use my package manager (apt) to install it. I have copied the spdlog directory under include to the root of my project directory, but when I try to compile I get include errors…
Nick Silvestri
  • 191
  • 1
  • 13
0
votes
1 answer

spdlog unexpected include reference point

I am trying to use spdlog library in an hello world. #include "spdlog/spdlog.h" int main() { return 0; } Since it is "header only" library I just copied it to my project's root and expected everything to just work. |+ hello.cpp …
kroiz
  • 1,782
  • 1
  • 23
  • 40
0
votes
1 answer

Log from a dynamically loaded library

I have a C++ desktop app that can log messages using the 'spdlog' library (https://github.com/gabime/spdlog). Now, I'd like to use the same logger from a dynamically loaded DLL. However, when I try to use spdlog from the DLL, I get a crash. How can…
Dess
  • 1,254
  • 10
  • 23
0
votes
1 answer

C++ | spdlog | How to have sincs with different formatters?

I am using spdlog library for C++ logging. I have a logger with both stdout and rotating_file_sink_mt sincs: auto std_out_sinc = std::make_shared(); auto file_sinc =…
motam79
  • 2,718
  • 1
  • 23
  • 41