From f0d817cf39987e7b7548863c86beac29440ab7c6 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 12 Jul 2023 02:04:57 +0100 Subject: Remove rang and use fmtlib for printing coloured messages. This supports more platforms (e.g. Haiku) and is actually still maintained unlike the former. All of this code should really be cleaned up for release (maybe by adding something like Anope's LOG_CONSOLE) but for now I've just replaced it with the fmtlib equivalent. --- src/socketengine.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/socketengine.cpp') diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 9a42e856d..c760b1a12 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -26,15 +26,14 @@ */ -#include - -#include - #ifndef _WIN32 # include # include +# include #endif +#include + #include "inspircd.h" #include "exitcodes.h" @@ -71,7 +70,7 @@ void EventHandler::OnEventHandlerError(int errornum) void SocketEngine::InitError() { - std::cerr << rang::style::bold << rang::fg::red << "FATAL ERROR!" << rang::style::reset << " Socket engine initialization failed. " << strerror(errno) << '.' << std::endl; + fmt::println(stderr, "{} Socket engine initialization failed. {}.", fmt::styled("FATAL ERROR!", fmt::emphasis::bold | fmt::fg(fmt::terminal_color::red)), strerror(errno)); InspIRCd::QuickExit(EXIT_STATUS_SOCKETENGINE); } -- cgit v1.3.1-10-gc9f91