<commit_before>#include "logging.h"

XPLogAggregator xplog_aggregator;
XPLogAggregator xplog_debug_aggregator;

thread_local XPLogger xplog(xplog_aggregator);
thread_local XPLogger xplog_debug(xplog_debug_aggregator);


XPLogAggregator::XPLogAggregator() {
    XPLMCreateFlightLoop_t callback_info{
        .structSize = sizeof(XPLMCreateFlightLoop_t),
        .callbackFunc = &XPLogAggregator::logging_callback,
        .phase = xplm_FlightLoop_Phase_BeforeFlightModel,
        .refcon = this,
    };

    callback_id = XPLMCreateFlightLoop(&callback_info);

    XPLMScheduleFlightLoop(callback_id, -1, 0);
}

XPLogAggregator::~XPLogAggregator() {
    XPLMDestroyFlightLoop(callback_id);

}

float XPLogAggregator::logging_callback(float /* inElapsedSinceLastCall */, float /* inElapsedTimeSinceLastFlightLoop */, int /* inCounter */, void * refcon) {
    XPLogAggregator * xpl = static_cast<XPLogAggregator *>(refcon);

    while(true) {
        std::optional<std::string> opt_message = xpl->message_queue.get();

        if(opt_message) {
            XPLMDebugString(xpl->prefix_.c_str());
            XPLMDebugString(opt_message->c_str());
        } else {
            return -1;
        }
    }
}<commit_msg>Reorder struct initializer to try to fix build on non-mac platforms.<commit_after>#include "logging.h"

XPLogAggregator xplog_aggregator;
XPLogAggregator xplog_debug_aggregator;

thread_local XPLogger xplog(xplog_aggregator);
thread_local XPLogger xplog_debug(xplog_debug_aggregator);


XPLogAggregator::XPLogAggregator() {
    XPLMCreateFlightLoop_t callback_info{
        .structSize = sizeof(XPLMCreateFlightLoop_t),
        .phase = xplm_FlightLoop_Phase_BeforeFlightModel,
        .callbackFunc = &XPLogAggregator::logging_callback,
        .refcon = this,
    };

    callback_id = XPLMCreateFlightLoop(&callback_info);

    XPLMScheduleFlightLoop(callback_id, -1, 0);
}

XPLogAggregator::~XPLogAggregator() {
    XPLMDestroyFlightLoop(callback_id);

}

float XPLogAggregator::logging_callback(float /* inElapsedSinceLastCall */, float /* inElapsedTimeSinceLastFlightLoop */, int /* inCounter */, void * refcon) {
    XPLogAggregator * xpl = static_cast<XPLogAggregator *>(refcon);

    while(true) {
        std::optional<std::string> opt_message = xpl->message_queue.get();

        if(opt_message) {
            XPLMDebugString(xpl->prefix_.c_str());
            XPLMDebugString(opt_message->c_str());
        } else {
            return -1;
        }
    }
}
{'fraction_non_alphanumeric': 0.10721483272873841, 'fraction_numerical': 0.0024183796856106408, 'mean_word_length': 4.014141414141414, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2818492', 'n_tokens_mistral': 865, 'n_tokens_neox': 873, 'n_words': 116}