benchmark/ordering.cpp
bool init_logger(const std::string& path) noexcept {
    try {
        /// Setup the console sink
        auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
        console_sink->set_level(spdlog::level::trace);
        console_sink->set_pattern("[%D %H:%M:%S] [%^%l%$] [Thread %t] [File:Line %@] [Function: %!] %v");
        console_sink->set_color_mode(spdlog::color_mode::always);

        /// setup the file sink
        auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(path, true);
        file_sink->set_level(spdlog::level::trace);

        /// setup the logger using both sinks
        spdlog::logger logger(logger_name, {console_sink, file_sink});
        logger.set_level(spdlog::level::debug);
        spdlog::set_default_logger(std::make_shared<spdlog::logger>(logger_name, spdlog::sinks_init_list({console_sink, file_sink})));
    } catch (const spdlog::spdlog_ex& ex) {
        std::cout << "Logger initialization failed: " << ex.what() << std::endl;
        return false; // if we fail to initialize the logger, return false
    }

    return true;
}
/**
 * initializes the logger; assumes that the folder containing the executable is in the same directory as the folder
 * storing the log text files.
 * @param path the path to the executable of this program
 * @return     boolean representing the success of the function
 */
initializes the logger; assumes that the folder containing the executable is in the same directory as the folder
storing the log text files.
@param path the path to the executable of this program
@return     boolean representing the success of the function
initializes the logger ; assumes that the folder containing the executable is in the same directory as the folder storing the log text files . @param path the path to the executable of this program @return boolean representing the success of the function
bool init_logger(const std::string& path) noexcept {
    try {
        auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
        console_sink->set_level(spdlog::level::trace);
        console_sink->set_pattern("[%D %H:%M:%S] [%^%l%$] [Thread %t] [File:Line %@] [Function: %!] %v");
        console_sink->set_color_mode(spdlog::color_mode::always);
        auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(path, true);
        file_sink->set_level(spdlog::level::trace);
        spdlog::logger logger(logger_name, {console_sink, file_sink});
        logger.set_level(spdlog::level::debug);
        spdlog::set_default_logger(std::make_shared<spdlog::logger>(logger_name, spdlog::sinks_init_list({console_sink, file_sink})));
    } catch (const spdlog::spdlog_ex& ex) {
        std::cout << "Logger initialization failed: " << ex.what() << std::endl;
        return false; 
    }
    return true;
}
bool init_logger ( const std :: string & path ) noexcept { try { auto console_sink = std :: make_shared < spdlog :: sinks :: stdout_color_sink_mt > ( ) ; console_sink -> set_level ( spdlog :: level :: trace ) ; console_sink -> set_pattern ( " " ) ; console_sink -> set_color_mode ( spdlog :: color_mode :: always ) ; auto file_sink = std :: make_shared < spdlog :: sinks :: basic_file_sink_mt > ( path , true ) ; file_sink -> set_level ( spdlog :: level :: trace ) ; spdlog :: logger logger ( logger_name , { console_sink , file_sink } ) ; logger . set_level ( spdlog :: level :: debug ) ; spdlog :: set_default_logger ( std :: make_shared < spdlog :: logger > ( logger_name , spdlog :: sinks_init_list ( { console_sink , file_sink } ) ) ) ; } catch ( const spdlog :: spdlog_ex & ex ) { std :: cout << " " << ex . what ( ) << std :: endl ; return false ; } return true ; }
initializes the logger; assumes that the folder containing the executable is in the same directory as the folder
 storing the log text files.
initializes the logger ; assumes that the folder containing the executable is in the same directory as the folder storing the log text files .
/// Setup the console sink /// setup the file sink /// setup the logger using both sinks // if we fail to initialize the logger, return false