- Super LightWeight logging system
- uses fmt for super faster printing
- doesn't include
<iostream>orfmtinREY_Logger.hh- what did I actually do then? ---> Read Features in this page 🤭
- LightWeight StackTracer - [ripped out from blender ]
- Google Breakpad implementation WIP
- CMake Package Manager:-
REY_FetchV4- an experimentScout [/find/look-for]-> just tell us where to scout/look for/find[Git] SubmoduleZipLinks[Git] Clone/Fetch😊 -> just tell us which repo & cloning path
- see
.\REY_FetchV4\REY_FetchV4_X_DOCS.cmake
// ---------- example. 1 ----------
#include "REY_Logger.hh"
int main(void) {
REY_LOG("Hello, World!");
REY_LOG_EX("Prints StackTrace after this text")
}
// ---------- example. 2:- you also got access to `fmt` 😄 ----------
#include <fmt/core.h>
int main(void) {
fmt::print("Hello, World!\n");
return 0;
}
/** cmake configure --> will automatically Fetch / Build / Link / IncludePath of `fmt`
* https://github.com/fmtlib/fmt */
// ---------- example. 3 ----------
// TBAIt's basically automatically handled 😉:-
git clone https://github.com/REYNEP/REY_LoggerNUtils <path>
# or
git add submoule https://github.com/REYNEP/REY_LoggerNUtils <path>
Way 1
# Open `REY_LoggerNUtils` in VSCODE
# F1 > CMake: Configure
# F1 > CMake: Build
# F1 > CMake: Install [Default Folder:- REY_LoggerNUtils/.install]
# You can optinally take a glimpse @ "REY_LoggerNUtils/CMakeLists.txt" 😜
# for better understanding.... it's pretty small
Way 2:- add these in your CMakeLists.txt
# add_subdirectory( <path/to/REY_LoggerNUtils> )
# target_link_libraries( <your_target_name> REY_LoggerNUtils )
Way 3:- REY_FetchV4
# copy:- `REY_FetchV4.cmake`
#`REY_FetchV4_X_RESET.cmake`
#`REY_FetchV4_X.REY_LoggerNUtils.cmake`
#`REY_FetchV4.REY_LoggerNUtils.cmake`
into wherever you keep your .CMakeFiles
# include(REY_FetchV4.REY_LoggerNUtils.cmake) in your CMakeLists.txt
Way 4:- Meson & Premake Support [TBA]
Way 5:- Ninja/MakeFiles + Python Downloader Script [TBA]REY_Logger.hhis lightweight- No
#include <cstdlib>or#include <iostream> - All
#includewas done inside#ifdef REY_LOGGER_IMPLEMENTATION- Actual Implementations compiled by:-
REY_Logger.cpp
- Actual Implementations compiled by:-
- So this is basically like a standalone
~500Linesof code- even if you
#include REY_Logger.hhin 1000s of files....- REY_Logger:- 500Lines / file
- std::iostream:- ~20,000-50,000 Lines / file --
- even if you
- So we basically had to make a lightweight wrapper around
std::cout- \see
class REY_Logger
- \see
- Also
malloc()-->REY_malloc()memcpy()-->REY_memcpy()REY_Utils::merge_sortis still template based....- also
REY_memcpyis used inREY_ArrayDYN<T>::resize--
- No
- LightWeight StackTracer - [ripped out from blender ]
- Google Breakpad implementation WIP
- CMake Package Manager:-
REY_FetchV4- an experimentScout [/find/look-for][Git] SubmoduleZipLinks[Git] Clone/Fetch😊
- see
.\REY_FetchV4\REY_FetchV4_X_DOCS.cmake
- Lots of External Libraries:- that you can just directly
#include- fmt
- breakpad
- rapidyaml, yyjson, nlohmannJSON
- Boost Software License - Version 1.0 - August 17th, 2003
V0.4:- WIPREY_FetchV4:- 1.Scout, 2.Submodule, 3.ZipLinks, 4.Clone/Fetch😊- WIP: StackTrace on Crash / Signal Handler /
google breakpad+boost stacktrace+StackWalker+google crashpad+sentry+raygun+BugSnag+RollBar
V0.3:- DONE.install:- it's a Folder forlib-REY_LoggerNUtils.lib& "external libraries" installation.forge:- 😉 a new idea for external-library management- added
.CMakeFiles/REY_FetchV2_fmt.cmake - added
.CMakeFiles/REY_FetchV3.cmake
V0.2:- Prefix_Tag:- 😢 REFACTORED ["amVK" --> "REY"]V0.1:- Initial Commit: moving from [GIST ---> GITHUB]V0.1beta:- https://gist.github.com/REYNEP/14a628ab270cae461a926ba212226492
- will be added soon in wiki
- assuming that you did
add_subdirectory(REY_LoggerNUtils)in your CMakeLists.txt .forge:-lib-REY_LoggerNUtils.libwill be INSTALLED herefmtwill be fetched here & installed here- I store/fetch/modify/custom-build External Libraries in here
- For the whole idea, check:- https://github.com/REYNEP/REY_LoggerNUtils/tree/main/.forge
- 🪵
Logging/Printing🖨️ & 🛠️Debugbing/StackTracing🧾-
fmt:- automatically "Fetched" --> Built --> "PUBLIC linked toREY_LoggerNUtils"- "PUBLIC" Linked:-
- i.e.
fmtwill be available to you too - i.e. You can just
#include <fmt/core.h> - &
fmtwill be automatically linked as you are linkingREY_LoggerNUtilsin CMAKE
- i.e.
Official Repo:- https://github.com/fmtlib/fmtWhat is it..?:- https://github.com/fmtlib/fmt?tab=readme-ov-file#examplesCMake / Using:- https://fmt.dev/11.1/get-started/CheatSheet / Code Examples:- https://hackingcpp.com/cpp/libs/fmt.html
- "PUBLIC" Linked:-
-
google breakpad:- [StackTracer on Crash]- very hard to build on windows.
- However I found a really cool & nice wiki & how-to about it
- https://github.com/d1vanov/quentier/wiki/Building-and-installation-of-Quentier's-dependencies#building-google-breakpad
- Took me Half an hour to find this guide & finally fkin build this shit
- Building Google Breakpad on Windows:- d1vanov's wiki on github
- BREAKPAD vs CRASHPAD
- https://stackoverflow.com/questions/52725299/what-is-the-difference-between-googles-breakpad-and-crashpad-libraries
Official Repo:- https://chromium.googlesource.com/breakpad/breakpadWhat is it..?:- https://chromium.googlesource.com/breakpad/breakpad/+/HEAD/docs/breakpad.pngCMake / Using:- d1vanov's wiki on githubCheatSheet / Code Examples:- Mozilla Intro, linux [starter-guide], mac, windows, processor-design, detes on stack-tracing, chatgptDocumentation:- HEAD/docs
-
- YAML & JSON
rapidyaml:Official Repo:- https://github.com/biojppm/rapidyamlWhat is it..?:- https://rapidyaml.readthedocs.io/latest/index.htmlCmake / Using:- https://rapidyaml.readthedocs.io/latest/sphinx_using.html#as-a-libraryOutside Usage:-🚨 Settings:- https://rapidyaml.readthedocs.io/latest/sphinx_using.html#cmake-build-settings-for-rymlCheatSheet / Code Examples:- CHATGPT/DeepSeek/AI or https://rapidyaml.readthedocs.io/latest/doxygen/group__doc__quickstart.html
taocpp-json:Official Repo:- https://github.com/taocpp/jsonDocumentation:- https://github.com/taocpp/json/blob/main/doc/Value-Class.md- not including this in
REY_LoggerNUtils/CMakeLists.txt - but you can use the
REY_FetchV4files & just include it yourself
yyjson:nlohmannJSON:Official Repo:- https://github.com/nlohmann/json
# --------------------
# OUTPUT Options:-
# Library Name:- REY_LoggerNUtils
Usage:- target_link_libraries(<target_name> REY_LoggerNUtils)
#
# Possible Untested Output Options:- [Might Not Work, cz of SCOPE Limitations]
${fmt::fmt} ---------> this is a "Target"
# this is How you use it:-
target_link_libraries(idk fmt::fmt)
target_include_directories(idk PUBLIC fmt::fmt)
# --------------------