spdlog | Fast C++ logging library
kandi X-RAY | spdlog Summary
kandi X-RAY | spdlog Summary
Very fast, header-only/compiled, C++ logging library. .
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of spdlog
spdlog Key Features
spdlog Examples and Code Snippets
Community Discussions
Trending Discussions on spdlog
QUESTION
I have a native library that uses spdlog
for internal logging.
The library is compiled as shared library and the results .so
files are then used in an Android project which has its own JNI and native c++ code which also uses spdlog
.
The first time a call to spdlog
is made, we experience a SIGSEGV
from it. After some research we found that since spdlog
is a header-only library it may cause issues when using it this way, so we changed to using it as a static library inside the native library.
This seems to solve the issue but now we get the SIGSEGV
on the first call to spdlog
from the application's native code.
Are there any limitations or issues with using spdlog
this way, specifically in an Android project?
Any suggestions on debugging the issue?
If any code can be helpful, let me know what is needed and I'll update the question
Edit
Also, it's worth noting that it only happens when the native library is built in Release mode. In Debug everything works as expected
...ANSWER
Answered 2022-Mar-28 at 13:08So turns out the solution was just to upgrade to a newer version of spdlog
QUESTION
Im writing a SDK for Windows and Mac OS in C++, and im using CMake. On windows, I'd like the compiled DLL to contain all necessary dependencies, instead of having separate DLLs for all third party libraries im using.
Here are the relevant sections of the MakeFile:
...ANSWER
Answered 2022-Feb-18 at 18:40I'm using Vcpkg for simplicity but you should compile your dependencies as static libraries instead of shared.
If you're using vcpkg you can install the dependencies as static like such
vcpkg.exe install openssl:x86-windows-static
Make sure you run CMake with VCPKG_TARGET_TRIPLET
set to x86-windows-static
or whatever platform you're on.
As you can see example.dll is now statically linked to OpenSSL.
Cheers
QUESTION
say we build our spdlog object as the following?
...ANSWER
Answered 2022-Jan-12 at 13:30Is there a method such as
logger->get_name()
or anything else that would return "some name"
There is.
QUESTION
I downloaded and followed the example 1.
Moved to example 2 (Create stdout/stderr logger object
) and got stuck. Actually I can run it as it is but if I change
spdlog::get("console")
to spdlog::get("err_logger")
it crashes.
Am I supposed to change it like that?
...ANSWER
Answered 2022-Jan-11 at 08:39Because you need to register err_logger
logger first. There is no default err_logger
as far as I know. spdlog::get()
returns logger based on its registered name, not variable.
You need a code like this. Code is complex and you may not need all of it though:
QUESTION
System:Ubuntu 18.04
I am trying to build Drake from source using Bazel, I have installed the prerequisite using the provided install_prereqs.sh
. However, when I am trying to build drake from source, I encounter a strange problem. It turns out to be related with the tools/workspace/pybind11/mkdoc.py
file and //bindings/pydrake:generate_pybind_coverage
target. The terminal output is shown below.
After I run
...ANSWER
Answered 2022-Jan-07 at 01:10The complaint is about the C++ standard library, i.e., libstc++
and its headers. The Clang compiler itself seems to be installed correctly, but it's looking for the GCC standard C++ library, and failing.
The problem might be if you have GCC 10 installed (or partially installed).
Does the https://github.com/RobotLocomotion/drake/issues/15652 advice help? Specifically:
QUESTION
I want to use FFmpeg to convert the input NV12 format to YUV420P.
I tried to use sws_scale conversion, but the colors are all green.
I have successfully converted YUYV422 to 420P using sws, but FAILED to convert NV12 to YUV420.
What should I change?
Here is my code:
...ANSWER
Answered 2022-Jan-04 at 22:52I can't see the problem from the pieces of code that you have posted.
Green colors are usually result of zero data (all elements of Y, U and V are zeros).
The reason for the zero content is probably because nothing is written to the destination (or source) buffers of the video frame.
I have created a "self contained" code sample that demonstrates the conversion from NV12 to YUV420 using sws_scale
.
Start by building synthetic input frame using FFmpeg (command line tool).
The command creates 320x240 video frame in raw NV12 format:
QUESTION
I have been trying to figure out why this is happening and maybe it is just due to inexperience at this point but could really use some help.
When I run my code, which is compiled into a DLL using C++20, I get that a debug assertion has failed with the expression being __acrt_first_block == header.
I narrowed down where the code is failing, but the weird part is that it runs just fine when I change the Init(std::string filePath function signature to not contain the parameter. The code is below and hope someone can help.
Logger.h
...ANSWER
Answered 2022-Jan-01 at 21:47For anyone else who runs into a similar problem, here is how I fixed it.
Essentially the function signature for the Init()
function was the problem. The std::string
parameter was causing the debug assertion to fire, my best guess as of right now was because of move semantics but that part I am still not sure on. So there are a couple of ways that I found to fix this.
Method 1:
Make the parameter a const char*
. I don't quite like this approach as it then relies on C style strings and if you are trying to write a program in modern C++, this is a huge step backwards.
Method 2:
Make the parameter a const std::string&
. Making it a const
reference to a string
prevents the move semantics (again as far as I know) and the assertion no longer fires. I prefer this fix as it keeps the program in modern C++.
I hope this helps anyone who has similar issues, and be careful with statics and move semantics.
QUESTION
I have come to the stackoverflow gurus for a better understanding and possibly a better solution to what is going on. So I'm typically pretty good with Makefiles but there is a critical piece that I am missing with my Makefile. So I typically have a one Makefile fits all for my projects and it works pretty well. Or it did until I found out that I wasn't linking the libraries properly. Since I discovered that my Makefile has been incorrect and I have been having trouble figuring out a way to solve this / have a better solution.
What I want to do
Let's say I have some .cpp files (ignore the awful naming)
...ANSWER
Answered 2021-Dec-05 at 03:05Your Makefile defines:
QUESTION
I did a test with the {fmt} and was super easy to change background color, but I can't get the same with spdlog.
I can get the same result with spdlog, but is a weird code
ANSWER
Answered 2021-Nov-17 at 16:27If I understand your question correctly, you want to format your spdlog
output using fmt
, rather than having to specify the escape sequences yourself. For this, you can use the fmt::format
function and use its output as a variable for spdlog
:
QUESTION
I am trying to read a .csv file into a map>
.
The .csv file represents a modbus register map, in the form name,register,register,register.... eg.
...ANSWER
Answered 2021-Nov-16 at 02:15Among other assumptions, the critical one is this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spdlog
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page