aboutsummaryrefslogtreecommitdiff
path: root/client/src/util/io.h
diff options
context:
space:
mode:
authorauth12 <[email protected]>2020-07-27 09:46:17 -0700
committerauth12 <[email protected]>2020-07-27 09:46:17 -0700
commita2e89fde1acc5b189c55e0b8b38146194e455cd0 (patch)
tree1f130027975733e0704a583aebb1a1832a22ec11 /client/src/util/io.h
parentCompile fix. (diff)
downloadloader-a2e89fde1acc5b189c55e0b8b38146194e455cd0.tar.xz
loader-a2e89fde1acc5b189c55e0b8b38146194e455cd0.zip
Removed spdlog, using fmt wrapper instead.
More process class changes, support for 32/64bit processes. Injection process improvements. Other small changes.
Diffstat (limited to 'client/src/util/io.h')
-rw-r--r--client/src/util/io.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/client/src/util/io.h b/client/src/util/io.h
index 0678e9f..c1ee932 100644
--- a/client/src/util/io.h
+++ b/client/src/util/io.h
@@ -1,12 +1,29 @@
#pragma once
-#include <spdlog/spdlog.h>
-#include <spdlog/sinks/basic_file_sink.h>
-#include <spdlog/sinks/stdout_color_sinks.h>
+#include <fmt/format.h>
+#include <fmt/color.h>
+
namespace io {
- extern std::shared_ptr<spdlog::logger> logger;
+ template<typename... Args>
+ void log(const std::string_view str, Args... params) {
+ fmt::print(fg(fmt::color::green) | fmt::emphasis::bold, "$> ");
+
+ std::string msg{str};
+ msg.append("\n");
+
+ fmt::print(msg, std::forward<Args>(params)...);
+ }
+
+ template<typename... Args>
+ void log_error(const std::string_view str, Args... params) {
+ fmt::print(fg(fmt::color::red) | fmt::emphasis::bold, "$> ");
+
+ std::string msg{str};
+ msg.append("\n");
+
+ fmt::print(msg, std::forward<Args>(params)...);
+ }
- void init();
bool read_file(const std::string_view name, std::vector<char>& out);
}; // namespace io