Exemplo n.º 1
0
 /**
  * Write log entry
  *
  * @param string  $message
  * @param array   $backtrace
  * @return bool|int
  */
 protected function _log($message, $backtrace = null)
 {
     if (!$this->_debug) {
         return true;
     }
     $data = sprintf("[%s] %s\n", date('r'), $message);
     if ($backtrace) {
         $debug = print_r($backtrace, true);
         $data .= $debug . "\n";
     }
     $data = strtr($data, '<>', '..');
     $filename = Util_Debug::log_filename('sns');
     return @file_put_contents($filename, $data, FILE_APPEND);
 }
 /**
  * Write log entry
  *
  * @param string  $local_path
  * @param string  $remote_path
  * @param string  $error
  * @return bool|int
  */
 function _log($local_path, $remote_path, $error)
 {
     $data = sprintf("[%s] [%s => %s] %s\n", date('r'), $local_path, $remote_path, $error);
     $data = strtr($data, '<>', '..');
     $filename = Util_Debug::log_filename('cdn');
     return @file_put_contents($filename, $data, FILE_APPEND);
 }
Exemplo n.º 3
0
 /**
  * Log
  *
  * @param string  $msg
  * @return bool
  */
 public static function log($msg)
 {
     $data = sprintf("[%s] [%s] [%s] %s\n", date('r'), $_SERVER['REQUEST_URI'], !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '-', $msg);
     $data = strtr($data, '<>', '..');
     $filename = Util_Debug::log_filename('minify');
     return @file_put_contents($filename, $data, FILE_APPEND);
 }
Exemplo n.º 4
0
 function debug_shutdown()
 {
     $strings = array();
     foreach ($this->processors as $processor) {
         $strings = $processor->w3tc_footer_comment($strings);
     }
     $request_time_total = microtime(true) - $this->request_time_start;
     $data = sprintf("\n[%s] [%s] [%s]\n", date('r'), $_SERVER['REQUEST_URI'], round($request_time_total, 4)) . implode("\n", $strings) . "\n";
     $data = strtr($data, '<>', '..');
     $filename = Util_Debug::log_filename('dbcache');
     @file_put_contents($filename, $data, FILE_APPEND);
 }
Exemplo n.º 5
0
 /**
  * Write log entry
  *
  * @param string  $url
  * @param string  $msg
  * @return bool|int
  */
 function _log($url, $msg)
 {
     if ($this->_debug) {
         $data = sprintf("[%s] [%s] %s\n", date('r'), $url, $msg);
         $data = strtr($data, '<>', '');
         $filename = Util_Debug::log_filename('varnish');
         return @file_put_contents($filename, $data, FILE_APPEND);
     }
     return true;
 }