Skip to content

Commit

Permalink
- Added success to logger
Browse files Browse the repository at this point in the history
- Updated submdules
  • Loading branch information
edunad committed Jun 24, 2024
1 parent 63401e1 commit fdeadb3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 239 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ if(NOT WIN32 AND RAWRBOX_USE_WAYLAND)
CPMAddPackage("https://gitlab.freedesktop.org/wayland/weston@13.0.3")
endif()

CPMAddPackage("gh:stephenberry/glaze@2.9.0")
CPMAddPackage("gh:stephenberry/glaze@2.9.2")

# ---
if(RAWRBOX_BUILD_RAWRBOX_NETWORK OR RAWRBOX_BUILD_RAWRBOX_ASSIMP)
Expand All @@ -172,7 +172,7 @@ if(RAWRBOX_BUILD_RAWRBOX_NETWORK OR RAWRBOX_BUILD_RAWRBOX_ASSIMP)
USE_CACHE
OFF
GIT_TAG
2.1.6
2.1.7
OPTIONS
#"ASM686 FALSE"
#"AMD64 FALSE"
Expand Down
231 changes: 0 additions & 231 deletions package-lock.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion rawrbox.scripting/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CPMAddPackage(
GITHUB_REPOSITORY
luau-lang/luau
GIT_TAG
0.630
0.631
OPTIONS
"LUAU_BUILD_CLI OFF"
"LUAU_BUILD_TESTS OFF"
Expand Down
2 changes: 1 addition & 1 deletion rawrbox.utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if(thread-pool_ADDED)
endif()

# DEPS ----
CPMAddPackage("gh:jeremy-rifkin/cpptrace@0.6.1")
CPMAddPackage("gh:jeremy-rifkin/cpptrace@0.6.2")
if(cpptrace_ADDED)
set_lib_runtime_mt(cpptrace-lib)
endif()
Expand Down
7 changes: 7 additions & 0 deletions rawrbox.utils/include/rawrbox/utils/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ namespace rawrbox {
if (this->_autoNewLine) fmt::print("\n");
}

template <typename... T>
void success(fmt::format_string<T...> fmt, T&&... args) {
auto str = fmt::format(fmt, std::forward<T>(args)...);
fmt::print("[{} ▒ {}]: {}", fmt::format(fmt::fg(fmt::color::lime_green), "SUCCESS"), fmt::format(fmt::fg(fmt::color::gold), this->_title), str);
if (this->_autoNewLine) fmt::print("\n");
}

template <typename... T>
static cpptrace::runtime_error err(const std::string& title, fmt::format_string<T...> fmt, T&&... args) {
auto str = fmt::format(fmt, std::forward<T>(args)...);
Expand Down
6 changes: 2 additions & 4 deletions rawrbox.utils/src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ namespace rawrbox {

void Settings::save() {
auto fileName = this->getFileName();
auto ec = glz::write_file_json(this->_settings, fileName, std::string{});
if (ec) {
throw this->_logger->error("Failed to save settings '{}'", fileName);
}
auto ec = glz::write_file_json<glz::opts{.prettify = true}>(this->_settings, fileName, std::string{});
if (ec) throw this->_logger->error("Failed to save settings '{}'", fileName);
}

void Settings::load(std::string data) {
Expand Down

0 comments on commit fdeadb3

Please sign in to comment.