Beispiel #1
0
 /**
  * @param string|array $data
  * @param string|array $message
  * @param string $filename  a part of file name under
  * YNMEDIAIMPORTER_LOG_PATH
  * @return void.
  */
 public static function log($data, $message = null)
 {
     if (false == YNMEDIAIMPORTER_DEBUG) {
         return;
     }
     if (null == self::$_log) {
         $file = YNMEDIAIMPORTER_LOG_PATH . '/importer.log';
         self::$_log = new Zend_Log(new Zend_Log_Writer_Stream($file));
     }
     if (!is_string($data)) {
         $data = var_export($data, 1);
     }
     if (null == $message) {
         $message = 'info';
     } else {
         if (!is_string($message)) {
             $message = var_export($message, 1);
         }
     }
     self::$_log->log($message . PHP_EOL . $data, Zend_Log::INFO);
 }