"switch logging to 2 (only errors) again"

This commit is contained in:
Ralf Becker 2008-11-13 06:35:18 +00:00
parent 77d28f30e8
commit 59aa84f761

View File

@ -211,7 +211,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
if (!$stmt->execute() || !($this->opened_fs_id = self::$pdo->lastInsertId('egw_sqlfs_fs_id_seq'))) if (!$stmt->execute() || !($this->opened_fs_id = self::$pdo->lastInsertId('egw_sqlfs_fs_id_seq')))
{ {
$this->opened_stream = $this->opened_path = $this->opened_mode = null; $this->opened_stream = $this->opened_path = $this->opened_mode = null;
error_log(__METHOD__."($url,$mode,$options) execute() failed: ".self::$pdo->errorInfo()); if (self::LOG_LEVEL) error_log(__METHOD__."($url,$mode,$options) execute() failed: ".self::$pdo->errorInfo());
return false; return false;
} }
if ($this->operation == self::STORE2DB) if ($this->operation == self::STORE2DB)
@ -891,7 +891,6 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
} }
} }
if (self::LOG_LEVEL > 1) error_log(__METHOD__."($url,$options): ".implode(', ',$this->opened_dir)); if (self::LOG_LEVEL > 1) error_log(__METHOD__."($url,$options): ".implode(', ',$this->opened_dir));
//print_r($this->opened_dir);
reset($this->opened_dir); reset($this->opened_dir);
return true; return true;
@ -991,7 +990,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
} }
self::$stat_cache[$path] = $info; self::$stat_cache[$path] = $info;
if (self::LOG_LEVEL > 1) error_log(__METHOD__."($url,$flags)=".str_replace("\n",'',print_r($info,true))); if (self::LOG_LEVEL > 1) error_log(__METHOD__."($url,$flags)=".array2string($info));
return self::_vfsinfo2stat($info); return self::_vfsinfo2stat($info);
} }
@ -1100,7 +1099,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
break; break;
} }
} }
//error_log(__METHOD__."($url,$check) ".($access?"access granted by $path=$rights":'no access!!!')); if (self::LOG_LEVEL > 1) error_log(__METHOD__."($url,$check) ".($access?"access granted by $path=$rights":'no access!!!'));
return $access; return $access;
} }
@ -1130,7 +1129,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
// sort by length descending, to allow more specific pathes to have precedence // sort by length descending, to allow more specific pathes to have precedence
uksort(self::$extended_acl,create_function('$a,$b','return strlen($b)-strlen($a);')); uksort(self::$extended_acl,create_function('$a,$b','return strlen($b)-strlen($a);'));
$GLOBALS['egw']->session->appsession('extended_acl',self::EACL_APPNAME,self::$extended_acl); $GLOBALS['egw']->session->appsession('extended_acl',self::EACL_APPNAME,self::$extended_acl);
//echo __METHOD__; print_r(self::$extended_acl); if (self::LOG_LEVEL > 1) error_log(__METHOD__.'() '.array2string(self::$extended_acl));
} }
/** /**
@ -1245,7 +1244,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
*/ */
static function id2path($fs_ids) static function id2path($fs_ids)
{ {
//error_log(__METHOD__.'('.print_r($fs_id,true).')'); if (self::LOG_LEVEL > 1) error_log(__METHOD__.'('.array2string($fs_id).')');
$ids = (array)$fs_ids; $ids = (array)$fs_ids;
$pathes = array(); $pathes = array();
// first check our stat-cache for the ids // first check our stat-cache for the ids
@ -1257,7 +1256,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
unset($ids[$key]); unset($ids[$key]);
if (!$ids) if (!$ids)
{ {
//error_log(__METHOD__.'('.print_r($fs_ids,true).')='.print_r($pathes,true).' *from stat_cache*'); if (self::LOG_LEVEL > 1) error_log(__METHOD__.'('.array2string($fs_ids).')='.array2string($pathes).' *from stat_cache*');
return is_array($fs_ids) ? $pathes : array_shift($pathes); return is_array($fs_ids) ? $pathes : array_shift($pathes);
} }
} }
@ -1298,7 +1297,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
$pathes[$fs_id] = $parent . '/' . $row['fs_name']; $pathes[$fs_id] = $parent . '/' . $row['fs_name'];
} }
//error_log(__METHOD__.'('.print_r($fs_ids,true).')='.print_r($pathes,true)); if (self::LOG_LEVEL > 1) error_log(__METHOD__.'('.array2string($fs_ids).')='.array2string($pathes));
return is_array($fs_ids) ? $pathes : array_shift($pathes); return is_array($fs_ids) ? $pathes : array_shift($pathes);
} }
@ -1324,7 +1323,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
// eGW addition to return the mime type // eGW addition to return the mime type
'mime' => $info['fs_mime'], 'mime' => $info['fs_mime'],
); );
//error_log(__METHOD__."($info[name]) = ".print_r($stat,true)); if (self::LOG_LEVEL > 1) error_log(__METHOD__."($info[name]) = ".array2string($stat));
return $stat; return $stat;
} }
@ -1514,7 +1513,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
*/ */
static function proppatch($path,array &$props) static function proppatch($path,array &$props)
{ {
error_log(__METHOD__."(".array2string($path).','.array2string($props)); if (self::LOG_LEVEL > 1) error_log(__METHOD__."(".array2string($path).','.array2string($props));
if (!is_numeric($path)) if (!is_numeric($path))
{ {
if (!($stat = self::url_stat($path,0))) if (!($stat = self::url_stat($path,0)))
@ -1583,7 +1582,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
{ {
if (!($stat = self::url_stat($id,0))) if (!($stat = self::url_stat($id,0)))
{ {
error_log(__METHOD__."(".array2string($path_ids).",$depth,$ns) path '$id' not found!"); if (self::LOG_LEVEL) error_log(__METHOD__."(".array2string($path_ids).",$depth,$ns) path '$id' not found!");
return false; return false;
} }
$id = $stat['ino']; $id = $stat['ino'];
@ -1619,7 +1618,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
unset($props[$id]); unset($props[$id]);
} }
} }
//foreach((array)$props as $k => $v) error_log(__METHOD__."($path_ids,$ns) $k => ".array2string($v)); if (self::LOG_LEVEL > 1) foreach((array)$props as $k => $v) error_log(__METHOD__."($path_ids,$ns) $k => ".array2string($v));
return $props; return $props;
} }
} }