Пример #1
0
 /**
  * Get or set the logging directory.
  *
  * @param   string  new log directory
  * @return  string
  */
 public static function log_directory($dir = NULL)
 {
     if (!empty($dir)) {
         // Get the directory path
         $dir = Scaffold_Utils::fix_path($dir);
         if (is_dir($dir) and is_writable($dir)) {
             // Change the log directory
             self::$log_directory = $dir;
         }
     }
     if (isset(self::$log_directory)) {
         return self::$log_directory;
     }
 }
Пример #2
0
 /**
  * Uses the logging class to log a message
  *
  * @author your name
  * @param $message
  * @return void
  */
 public static function log($message, $level)
 {
     if ($level <= self::$error_threshold) {
         self::error($message);
     } else {
         Scaffold_Log::log($message, $level);
     }
 }
Пример #3
0
 function testSave()
 {
     $this->setup();
     Scaffold_Log::log('This should be logged');
     $this->assertTrue(Scaffold_Log::save());
 }