<commit_before><?php

class KalturaLogger implements IKalturaLogger {

	var $logDir = null;
	var $enabled = false;

	function __construct( $logDir = null, $enabled = false ) {
		if( !$logDir ) {
			$enabled = false;
		}
		$this->logDir = $logDir;
		$this->enabled = $enabled;
	}

	function log( $msg ) {

		if( !$this->enabled ) {
			return false;
		}

		$logDir = $this->logDir . '/logs';
		$logFile = $logDir . '/' . date("Y-m-d") . '_kalturaClientLog.txt';

		// try to create log dir if not exists
		if( ! file_exists($logDir) ) {
			mkdir( $logDir );
		}

		$msg = $msg . "\n";
		
		@file_put_contents( $logFile, $msg, FILE_APPEND);
		
	}
}<commit_msg>hide errors when using mkdir<commit_after><?php

class KalturaLogger implements IKalturaLogger {

	var $logDir = null;
	var $enabled = false;

	function __construct( $logDir = null, $enabled = false ) {
		if( !$logDir ) {
			$enabled = false;
		}
		$this->logDir = $logDir;
		$this->enabled = $enabled;
	}

	function log( $msg ) {

		if( !$this->enabled ) {
			return false;
		}

		$logDir = $this->logDir . '/logs';
		$logFile = $logDir . '/' . date("Y-m-d") . '_kalturaClientLog.txt';

		// try to create log dir if not exists
		if( ! file_exists($logDir) ) {
			@mkdir( $logDir );
		}

		$msg = $msg . "\n";
		
		@file_put_contents( $logFile, $msg, FILE_APPEND);
		
	}
}
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.0, 'mean_word_length': 2.4714640198511164, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '399037', 'n_tokens_mistral': 597, 'n_tokens_neox': 513, 'n_words': 120}