Exemplo n.º 1
0
function _log($text, $data = '')
{
    global $shLogger;
    $sefConfig =& shRouter::shGetConfig();
    static $shutdownRegistered = false;
    if (empty($sefConfig) || empty($sefConfig->debugToLogFile)) {
        return;
    }
    if (!empty($sefConfig->debugDuration) && time() - $sefConfig->debugStartedAt > $sefConfig->debugDuration) {
        return;
    }
    if (empty($shLogger)) {
        $shLogger = new shSimpleLogger($GLOBALS['shConfigLiveSite'], sh404SEF_ADMIN_ABS_PATH . 'logs/', 'sh404SEF_debug_log', $sefConfig->debugToLogFile);
    }
    if (!$shutdownRegistered) {
        register_shutdown_function('shCloseLogFile');
        $shutdownRegistered = true;
    }
    $shLogger->log($text, $data);
}
function _log($text, $data = '') {

  global $shLogger;
  $sefConfig = & Sh404sefFactory::getConfig();
  static $shutdownRegistered = false;

  if (empty($sefConfig) || empty($sefConfig->debugToLogFile)) return;
  if (!empty($sefConfig->debugDuration) && (time()-$sefConfig->debugStartedAt) > $sefConfig->debugDuration)
  return;
  if (empty($shLogger)) {
    $shLogger = new shSimpleLogger( Sh404sefFactory::getPageInfo()->getDefaultLiveSite(),
    sh404SEF_ADMIN_ABS_PATH.'logs/',
                    'sh404SEF_debug_log',
    $sefConfig->debugToLogFile);
  }
  if (!$shutdownRegistered) {
    register_shutdown_function('shCloseLogFile');
    $shutdownRegistered = true;
  }
  $shLogger->log($text, $data);
}