cjappl / rtlog-cpp Goto Github PK
View Code? Open in Web Editor NEWReal-time safe logger for C++ using lock free queues!
License: Other
Real-time safe logger for C++ using lock free queues!
License: Other
Currently, it's required that there is only one thread doing RT Logging (enqueuing ), and another doing the actual loging (dequeing)
ReaderWriterQueue is SPSC, we could possible use ConcurrentQueue by the same author to support multiple realtime threads.
NDJSON is a blessing for logs. It would be great to have a running example of how to use it with rtlog
.
It's possible that not everyone wants to use the sequence number feature.
Is there a reasonable way to make it optional?
Hi, first of all, thanks for this! I've been looking for a proper realtime logging lib for a while without luck, but this looks very promising! :)
I'm having some trouble setting the build up correctly.
Basically the problem is this: I have a header (Logging.h
) where all the logging macros, types and severity enums are defined. This includes rtlog.h
. However, when Logging.h
is then included where ever I need to log things I get duplicate symbols when linking:
[1/1] Linking CXX executable audioapp
FAILED: audioapp
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/audioapp.dir/Logging.cpp.o CMakeFiles/audioapp.dir/main.cpp.o -o audioapp && :
duplicate symbol '_stbsp_set_separators' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
duplicate symbol '_stbsp_vsprintf' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
duplicate symbol '_stbsp_sprintf' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
duplicate symbol '_stbsp_vsnprintf' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
duplicate symbol '_stbsp_snprintf' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
duplicate symbol '_stbsp_vsprintfcb' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
duplicate symbol 'evr::gRealtimeLogger' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
duplicate symbol 'evr::gSequenceNumber' in:
CMakeFiles/audioapp.dir/Logging.cpp.o
CMakeFiles/audioapp.dir/main.cpp.o
ld: 8 duplicate symbols for architecture x86_64
I've made a dead simple example project here, so you can reproduce what I'm doing.
It seems the issue comes down to stb_sprintf.h
being built with STB_SPRINTF_IMPLEMENTATION
multiple times (one for each cpp including my logging header.
Am I setting this up in a weird way?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.