<commit_before>`use strict`;

let appInsights = require(`applicationinsights`);
let appInsightsClient = appInsights.getClient();

function raiseException(errorMsg, exit, context){
    context.log('github-repositories error occurred: ' + errorMsg);

    if(appInsightsClient.config){
        appInsightsClient.trackException(new Error(errorMsg));
        if(exit && context){
            context.log("Exiting from error " + errorMsg);
            context.done(errorMsg);
        }
    }else{
        context.log('App Insight is not properly setup. Please make sure APPINSIGHTS_INSTRUMENTATIONKEY is defined');
    }
}   

let helper = {
    raiseException : raiseException
}
module.exports = helper;<commit_msg>changed error logging to use error stram<commit_after>`use strict`;

let appInsights = require(`applicationinsights`);
let appInsightsClient = appInsights.getClient();

function raiseException(errorMsg, exit, context){
    context.log.error('Error occurred: ' + errorMsg);

    if(appInsightsClient.config){
        appInsightsClient.trackException(new Error(errorMsg));
    } 
    else {
        context.log.error('App Insight is not properly setup. Please make sure APPINSIGHTS_INSTRUMENTATIONKEY is defined');
    }
    if(exit && context){
        context.log("Exiting from error " + errorMsg);
        context.done(errorMsg);
    }
}   

let helper = {
    raiseException : raiseException
}
module.exports = helper;
{'fraction_non_alphanumeric': 0.106993006993007, 'fraction_numerical': 0.0, 'mean_word_length': 3.73841059602649, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3501456', 'n_tokens_mistral': 408, 'n_tokens_neox': 400, 'n_words': 94}