diff options
| author | auth12 <[email protected]> | 2020-07-27 10:02:52 -0700 |
|---|---|---|
| committer | auth12 <[email protected]> | 2020-07-27 10:02:52 -0700 |
| commit | 9eeebaa4e90dedcbfcc38066b6b35e5e08c94c08 (patch) | |
| tree | 24efa461b0a8de85b35b9ec8ca21628432336925 /client | |
| parent | Removed spdlog, using fmt wrapper instead. (diff) | |
| download | loader-9eeebaa4e90dedcbfcc38066b6b35e5e08c94c08.tar.xz loader-9eeebaa4e90dedcbfcc38066b6b35e5e08c94c08.zip | |
Fixed support for colored text.
Diffstat (limited to 'client')
| -rw-r--r-- | client/client.vcxproj | 2 | ||||
| -rw-r--r-- | client/src/util/io.h | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/client/client.vcxproj b/client/client.vcxproj index 7e4b574..52c45bd 100644 --- a/client/client.vcxproj +++ b/client/client.vcxproj @@ -135,7 +135,7 @@ <ConformanceMode>true</ConformanceMode> <LanguageStandard>stdcpplatest</LanguageStandard> <AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)wolfssl;$(SolutionDir)..\shared;$(SolutionDir)..\shared\spdlog\include;$(IncludePath)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <ExceptionHandling>Sync</ExceptionHandling> <Optimization>MaxSpeed</Optimization> </ClCompile> diff --git a/client/src/util/io.h b/client/src/util/io.h index c1ee932..400c089 100644 --- a/client/src/util/io.h +++ b/client/src/util/io.h @@ -7,7 +7,9 @@ namespace io { template<typename... Args> void log(const std::string_view str, Args... params) { - fmt::print(fg(fmt::color::green) | fmt::emphasis::bold, "$> "); + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN); + fmt::print("$> "); + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); std::string msg{str}; msg.append("\n"); @@ -17,7 +19,9 @@ namespace io { template<typename... Args> void log_error(const std::string_view str, Args... params) { - fmt::print(fg(fmt::color::red) | fmt::emphasis::bold, "$> "); + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED); + fmt::print("$> "); + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); std::string msg{str}; msg.append("\n"); |