<commit_before>##Error logger version 2

from time import gmtime, strftime
import time
import os
import re
from traceback import format_exc

def log ( self ):

	if os.path.exists(self.config["log-path"]):	#Checking if log-path in config is valid and exists

		try:
			brackets = self.config["TimestampBrackets"].split(",") #Looking brackets from the config file

			log = self.config["log-path"]+"error.log"

			if self.config["errLoglevel"] != 0:
				if self.config["errLoglevel"] == 1: ## this level records only the error
					logline = "{0}{1}{2} {3}.".format( ## 0-2 timestamp, 3 error message
									brackets[0], strftime(self.config["timeformat"]), brackets[1], self.errormsg)

				elif self.config["errLoglevel"] == 2: ## error with a backtrace
					try:
						traceback = format_exc()
					except AttributeError:
						traceback = None
					logline = "{0}{1}{2} {3}.\r\n{4}\r\n".format( ## 0-2 timestamp, 3 error message
									brackets[0], strftime(self.config["timeformat"]), brackets[1], self.errormsg, traceback)	
													
				with open(log, "a") as logi: #Opening the log and appending the latest result
					logi.write(logline)
					logi.flush()

		except Exception as e:
			print(format_exc())
			print("{0}[ERROR]-[sysErrorLog] log()(1) stating: {1}, Plus that im a retard, and i cant log my own errors :(({2}".format(self.color("red"),e,self.color("end")))<commit_msg>oops, forgot to remove that<commit_after>##Error logger version 2

from time import gmtime, strftime
import time
import os
import re
from traceback import format_exc

def log ( self ):

	if os.path.exists(self.config["log-path"]):	#Checking if log-path in config is valid and exists

		try:
			brackets = self.config["TimestampBrackets"].split(",") #Looking brackets from the config file

			log = self.config["log-path"]+"error.log"

			if self.config["errLoglevel"] != 0:
				if self.config["errLoglevel"] == 1: ## this level records only the error
					logline = "{0}{1}{2} {3}.".format( ## 0-2 timestamp, 3 error message
									brackets[0], strftime(self.config["timeformat"]), brackets[1], self.errormsg)

				elif self.config["errLoglevel"] == 2: ## error with a backtrace
					try:
						traceback = format_exc()
					except AttributeError:
						traceback = None
					logline = "{0}{1}{2} {3}.\r\n{4}\r\n".format( ## 0-2 timestamp, 3 error message
									brackets[0], strftime(self.config["timeformat"]), brackets[1], self.errormsg, traceback)	
													
				with open(log, "a") as logi: #Opening the log and appending the latest result
					logi.write(logline)
					logi.flush()

		except Exception as e:
			print("{0}[ERROR]-[sysErrorLog] log()(1) stating: {1}, Plus that im a retard, and i cant log my own errors :(({2}".format(self.color("red"),e,self.color("end")))
{'fraction_non_alphanumeric': 0.15282272563825963, 'fraction_numerical': 0.019417475728155338, 'mean_word_length': 3.7232597623089982, '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': '2942040', 'n_tokens_mistral': 1125, 'n_tokens_neox': 900, 'n_words': 266}