Project

General

Profile

Bug #90250

Updated by Sybille Peters over 4 years ago

GeneralUtility::deprecationLog() in 9.5 writes deprecation logs to deprecation file which you can't turn off 

 (1) 

 <pre><code class="php"> 
 public static function deprecationLog($msg) 
     { 
         static::writeDeprecationLogFileEntry('GeneralUtility::deprecationLog() will be removed in TYPO3 v10.0, use "trigger_error("Given reason", E_USER_DEPRECATED);" to log deprecations.'); 
         trigger_error($msg, E_USER_DEPRECATED); 
     } 

 </code></pre> 


 I don't understand why this function does both: use trigger_error and writeDeprecationLogFileEntry. One would be enough, I guess.  

 Also, writeDeprecationLogFileEntry() writes directly to a logfile which you can't deactivate - AFAICS. 

 <pre><code class="php"> 
 $destination = Environment::getVarPath() . '/log/deprecation_' . self::shortMD5(Environment::getProjectPath() . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '.log'; 
      
 </code></pre> 
 


 Some extensions use GeneralUtility::deprecationLog() 

 (2) 

 You can turn off (some) deprecation logging via the logging framework (I think) think), but this is somewhat hidden and not inuitive or well documented. (though I may have missed this).  

 <pre><code class="php"> 
 unset($GLOBALS['TYPO3_CONF_VARS']['LOG']['TYPO3']['CMS']['deprecations']); 
 </code></pre> 

Back