<commit_before> //
 // This file is part of Easylogging++ samples
 // PerformanceTrackingCallback sample to customize performance output
 //
 // Revision 1.0
 // @author mkhan3189
 //

#include "easylogging++.h"

_INITIALIZE_EASYLOGGINGPP

class MyPerformanceTrackingOutput : public el::PerformanceTrackingCallback {
public:
    MyPerformanceTrackingOutput() {
        el::PerformanceTrackingCallback* defaultCallback = el::Helpers::performanceTrackingCallback<el::base::DefaultPerformanceTrackingCallback>("DefaultPerformanceTrackingCallback");
//        defaultCallback->setEnabled(false);
    }
    virtual ~MyPerformanceTrackingOutput() {
        el::PerformanceTrackingCallback* defaultCallback = el::Helpers::performanceTrackingCallback<el::base::DefaultPerformanceTrackingCallback>("DefaultPerformanceTrackingCallback");
        defaultCallback->setEnabled(true);
    }
protected:
    void handle(const el::PerformanceTrackingData* data) {
        if (data->firstCheckpoint()) { return; } // ignore first check point
        el::base::type::stringstream_t ss;
        ss << data->blockName()->c_str() << " took " <<  *data->formattedTimeTaken() << " to run";
        if (data->dataType() == el::PerformanceTrackingData::DataType::Checkpoint) {
            ss << " [CHECKPOINT ONLY] ";
        }
        CLOG(INFO, data->loggerId().c_str()) << ss.str();
    }
};

int main(void) {

    TIMED_SCOPE(mainBlock, "main");

    el::Helpers::installPerformanceTrackingCallback<MyPerformanceTrackingOutput>("MyPerformanceTrackingOutput");

    {<commit_msg>updated sample<commit_after> //
 // This file is part of Easylogging++ samples
 // PerformanceTrackingCallback sample to customize performance output
 //
 // Revision 1.0
 // @author mkhan3189
 //

#include "easylogging++.h"

_INITIALIZE_EASYLOGGINGPP

class MyPerformanceTrackingOutput : public el::PerformanceTrackingCallback {
public:
    MyPerformanceTrackingOutput() {
        el::PerformanceTrackingCallback* defaultCallback = 
            el::Helpers::performanceTrackingCallback<el::base::DefaultPerformanceTrackingCallback>("DefaultPerformanceTrackingCallback");
        defaultCallback->setEnabled(false);
    }
    virtual ~MyPerformanceTrackingOutput() {
        el::PerformanceTrackingCallback* defaultCallback = 
            el::Helpers::performanceTrackingCallback<el::base::DefaultPerformanceTrackingCallback>("DefaultPerformanceTrackingCallback");
        defaultCallback->setEnabled(true);
    }
protected:
    void handle(const el::PerformanceTrackingData* data) {
        if (data->firstCheckpoint()) { return; } // ignore first check point
        el::base::type::stringstream_t ss;
        ss << data->blockName()->c_str() << " took " <<  *data->formattedTimeTaken() << " to run";
        if (data->dataType() == el::PerformanceTrackingData::DataType::Checkpoint) {
            ss << " [CHECKPOINT ONLY] ";
        }
        CLOG(INFO, data->loggerId().c_str()) << ss.str();
    }
};

int main(void) {

    TIMED_SCOPE(mainBlock, "main");

    el::Helpers::installPerformanceTrackingCallback<MyPerformanceTrackingOutput>("MyPerformanceTrackingOutput");

    {
{'fraction_non_alphanumeric': 0.13006056742110297, 'fraction_numerical': 0.003825310806503028, 'mean_word_length': 4.373287671232877, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 25, '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': '3857860', 'n_tokens_mistral': 889, 'n_tokens_neox': 854, 'n_words': 143}