<commit_before>var nlobjRecord = require('../modules/nlobjRecord.js');
var nlobjSearchFilter = require('../modules/nlobjSearchFilter.js');
var nlobjSearchColumn = require('../modules/nlobjSearchColumn.js');
var nlobjSearchResult = require('../modules/nlobjSearchResult.js');
var nlobjError = require('../modules/nlobjError.js');
var nlobjContext = require('../modules/nlobjContext.js');
var nodemailer = require('nodemailer');
var pickupTransport = require('nodemailer-pickup-transport');

exports.getDefaultContext = function(opts) {

  if(!opts) {
    opts = {};
  }

  var defaultContextOptions = opts;
  var recordsArray = [];
  var recordId = 0;
  var recordType = '';
  var nlobjContext;


  var nlapiLogExecution = function(type,title,details) {
    if(!defaultContextOptions.suppressNlapiLogOutput) {
      console.log("TYPE: "+type+" | TITLE: "+title+" | DETAILS: "+details);
    }
  };

  var nlapiCreateError = function(code,details,suppressNotification) {
    return new Error("NLAPI ERROR CODE: "+code+" | DETAILS: "+details+" | SUPPRESS NOTIFICATION: "+suppressNotification);
  };

  var nlapiGetRecordId = function() {
    return recordId;
  };

  var nlapiSetRecordId = function(id) {
    recordId = id;
  };

  var nlapiGetRecordType = function() {
    return recordType;
  };

  var nlapiSetRecordType = function(type) {
    recordType = type;
  };

  var nlapiCreateRecord = function(type,initializeValues) {
    var record = new nlobjRecord(type);
    return record;
  };

  var nlapiDeleteRecord = function(type,id) {
    for(var i = 0; i < recordsArray.length; i++) {<commit_msg>Added NlapiLogOutLevel option to limit outputs the same way netsuite does<commit_after>var nlobjRecord = require('../modules/nlobjRecord.js');
var nlobjSearchFilter = require('../modules/nlobjSearchFilter.js');
var nlobjSearchColumn = require('../modules/nlobjSearchColumn.js');
var nlobjSearchResult = require('../modules/nlobjSearchResult.js');
var nlobjError = require('../modules/nlobjError.js');
var nlobjContext = require('../modules/nlobjContext.js');
var nodemailer = require('nodemailer');
var pickupTransport = require('nodemailer-pickup-transport');


var executionLogLevelMappings ={
  debug: 1,
  audit: 2,
  error: 3,
  emergency: 4,
  system: 5
}
 

exports.getDefaultContext = function(opts) {

  if(!opts) {
    opts = {};
  }

  var defaultContextOptions = opts;
  var recordsArray = [];
  var recordId = 0;
  var recordType = '';
  var nlobjContext;


   var nlapiLogExecution = function(type,title,details) {
    if(defaultContextOptions.suppressNlapiLogOutput) {
      return
    }
    var level = executionLogLevelMappings[type.toLowerCase()];
    var minLevel = 0;
    if(defaultContextOptions.NlapiLogOutLevel){
      minLevel = executionLogLevelMappings[defaultContextOptions.NlapiLogOutLevel.toLowerCase()]
    }
    if(level >= minLevel){
      console.log("TYPE: "+type+" | TITLE: "+title+" | DETAILS: "+details)
    }
  }

  var nlapiCreateError = function(code,details,suppressNotification) {
    return new Error("NLAPI ERROR CODE: "+code+" | DETAILS: "+details+" | SUPPRESS NOTIFICATION: "+suppressNotification);
  };

  var nlapiGetRecordId = function() {
    return recordId;
  };

  var nlapiSetRecordId = function(id) {
    recordId = id;
  };

  var nlapiGetRecordType = function() {
    return recordType;
  };

  var nlapiSetRecordType = function(type) {
    recordType = type;
  };

  var nlapiCreateRecord = function(type,initializeValues) {
    var record = new nlobjRecord(type);
    return record;
  };

  var nlapiDeleteRecord = function(type,id) {
    for(var i = 0; i < recordsArray.length; i++) {
{'fraction_non_alphanumeric': 0.13497942386831277, 'fraction_numerical': 0.0027434842249657062, 'mean_word_length': 4.253602305475504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '4379202', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1162, 'n_words': 238}