<commit_before>
// This is the logging spreadsheet I'm using.
var logSheet;
var logSheetID = '<KEY>';
var maxRows = 3000;
var DEBUG = true;

function log(text) {
  if (DEBUG) {
    if (logSheet === undefined) {
      logSheet = SpreadsheetApp.openById(logSheetID);
    }
    if (logSheet.getLastRow() > maxRows) {
      logSheet.deleteRows(2, logSheet.getLastRow() - 1);
    }

    logSheet.appendRow([new Date().toString().slice(0, -15), text, Session.getActiveUser().getEmail(), MAILMAN_VERSION]);
  }

}<commit_msg>Fixed a bug in the Logger. It now properly clears the logging sheet after a specified number of rows.<commit_after>
// This is the logging spreadsheet I'm using.
var logSheet;
var logSheetID = '1IBQrb0zET4Zh_KpdpTGVww_y15SGTOmo8B9ZM9ZXVzg';
var maxRows = 3000;
var DEBUG = true;

function log(text) {
  if (DEBUG) {
    if (logSheet === undefined) {
      logSheet = SpreadsheetApp.openById(logSheetID);
    }
    if (logSheet.getLastRow() > maxRows) {
      var sheet = logSheet.getSheets()[0];
      sheet.getRange(2, 1, logSheet.getLastRow() - 1, logSheet.getLastColumn()).clear();
    }

    logSheet.appendRow([new Date().toString().slice(0, -15), text, Session.getActiveUser().getEmail(), MAILMAN_VERSION]);
  }

}
{'fraction_non_alphanumeric': 0.14135702746365106, 'fraction_numerical': 0.022617124394184167, 'mean_word_length': 3.9166666666666665, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '6566705', 'n_tokens_mistral': 445, 'n_tokens_neox': 418, 'n_words': 103}