spdlog as a DLL
spdlog is great but based on header and static variables. That means it's impossible today to use spdlog as-is in a program made of .exe and .dlls to write logs in one file. The exe and each dlls try to open the file for writing.
I suggest that spdlog have an option to be built as a dll encapsulating the static variables.
Hi Ubiquite,
I've managed to pack SpdLog into a DLL. You may access my branch at "https://github.com/vwbij/spdlog".
vwbij, how am I supposed to use it ?
First you have to build the DLL. Download the sources and compile the DLL with VisualStudio 2015 or similar, 2010 does not work! You may choose between unicode or ansi build.
You can use the DLL using a importlib or using LoadLibrary / function pointers.
The base interface is in "spdloglb.h", also the printf style functions with variable parameter lists. The file has got also some basic documentation.
In "spdlog_vararg.h" you find functions with a variable parameter list object. I created this because variable parameter lists in plain C export functions are normally only possible using the printf style variable parameter list. This method is not type safe and error prone. In this header a object is defined that you may instantiate and feed with parameters with a streaming interface.
Hope this helps, Volker
It would be way simpler to use if it's cmake-yfied
Ok, I have no experience with CMake, and as far as I read CMake supports Visual Studio up to 2010, that is not enough for a successful build...
It supports latest Visual Studio, you may have to update your cmake install.
I do not have any CMake install, never done anything with it. So if somebody knows how to do it, he is welcome to create a CMake builder for this dll. For me, the most easy way is to click onto a project icon and build it via the installed Visual Studio.