ManiaLib 1.0b1 API Reference

Source for file Debug.class.php

Documentation is available at Debug.class.php

  1. <?php 
  2. /**
  3.  * @author Maxime Raoust
  4.  * @copyright 2009-2010 NADEO
  5.  * @package ManiaLib
  6.  */
  7.  
  8. /** 
  9.  * Debug methods
  10.  * @package ManiaLib
  11.  * @subpackage Helpers
  12.  */ 
  13. abstract class Debug
  14. {
  15.     const LOG_DATE true;
  16.     const LOG_NO_DATE false;
  17.     
  18.     /**
  19.      * Writes a message in the debug log
  20.      * @param string The message
  21.      * @param boolean Whether to add the date to the message
  22.      * @param string The log filename
  23.      */
  24.     static function log($message$addDate self::LOG_DATE$logFilename APP_DEBUG_LOG)
  25.     {
  26.         $message ($addDate?date('c'):'').'  '.print_r($messagetrue)."\n";
  27.         file_put_contents($logFilename$messageFILE_APPEND);
  28.     }
  29.     
  30.     /**
  31.      * FOOBAR!
  32.      * Dump the message in the Manialink explorer, only available when DEBUG_LEVEL is 1
  33.      */
  34.     static function foobar($message)
  35.     {
  36.         ErrorHandling::showDebugDialog(print_r($messagetrue));
  37.     }
  38. }
  39.  
  40. ?>