Index: trunk/include/ws_functions/pwg.images.php
===================================================================
--- trunk/include/ws_functions/pwg.images.php	(revision 31031)
+++ trunk/include/ws_functions/pwg.images.php	(revision 31102)
@@ -183,7 +183,7 @@
 function merge_chunks($output_filepath, $original_sum, $type)
 {
-  global $conf;
-
-  ws_logfile('[merge_chunks] input parameter $output_filepath : '.$output_filepath);
+  global $conf, $logger;
+
+  $logger->debug('[merge_chunks] input parameter $output_filepath : '.$output_filepath, 'WS');
 
   if (is_file($output_filepath))
@@ -207,5 +207,5 @@
       if (preg_match($pattern, $file))
       {
-        ws_logfile($file);
+        $logger->debug($file, 'WS');
         $chunks[] = $upload_dir.'/'.$file;
       }
@@ -217,5 +217,5 @@
 
   if (function_exists('memory_get_usage')) {
-    ws_logfile('[merge_chunks] memory_get_usage before loading chunks: '.memory_get_usage());
+    $logger->debug('[merge_chunks] memory_get_usage before loading chunks: '.memory_get_usage(), 'WS');
   }
 
@@ -227,5 +227,5 @@
 
     if (function_exists('memory_get_usage')) {
-      ws_logfile('[merge_chunks] memory_get_usage on chunk '.++$i.': '.memory_get_usage());
+      $logger->debug('[merge_chunks] memory_get_usage on chunk '.++$i.': '.memory_get_usage(), 'WS');
     }
 
@@ -239,5 +239,5 @@
 
   if (function_exists('memory_get_usage')) {
-    ws_logfile('[merge_chunks] memory_get_usage after loading chunks: '.memory_get_usage());
+    $logger->debug('[merge_chunks] memory_get_usage after loading chunks: '.memory_get_usage(), 'WS');
   }
 }
@@ -825,5 +825,5 @@
 function ws_images_add_chunk($params, $service)
 {
-  global $conf;
+  global $conf, $logger;
 
   foreach ($params as $param_key => $param_value)
@@ -833,11 +833,10 @@
       continue;
     }
-    ws_logfile(
-      sprintf(
-        '[ws_images_add_chunk] input param "%s" : "%s"',
-        $param_key,
-        is_null($param_value) ? 'NULL' : $param_value
-        )
-      );
+
+    $logger->debug(sprintf(
+      '[ws_images_add_chunk] input param "%s" : "%s"',
+      $param_key,
+      is_null($param_value) ? 'NULL' : $param_value
+      ), 'WS');
   }
 
@@ -857,5 +856,5 @@
     );
 
-  ws_logfile('[ws_images_add_chunk] data length : '.strlen($params['data']));
+  $logger->debug('[ws_images_add_chunk] data length : '.strlen($params['data']), 'WS');
 
   $bytes_written = file_put_contents(
@@ -882,7 +881,7 @@
 function ws_images_addFile($params, $service)
 {
-  ws_logfile(__FUNCTION__.', input :  '.var_export($params, true));
-
-  global $conf;
+  global $conf, $logger;
+
+  $logger->debug(__FUNCTION__, 'WS', $params);
 
   // what is the path and other infos about the photo?
@@ -975,15 +974,13 @@
 function ws_images_add($params, $service)
 {
-  global $conf, $user;
+  global $conf, $user, $logger;
 
   foreach ($params as $param_key => $param_value)
   {
-    ws_logfile(
-      sprintf(
-        '[pwg.images.add] input param "%s" : "%s"',
-        $param_key,
-        is_null($param_value) ? 'NULL' : $param_value
-        )
-      );
+    $logger->debug(sprintf(
+      '[pwg.images.add] input param "%s" : "%s"',
+      $param_key,
+      is_null($param_value) ? 'NULL' : $param_value
+      ), 'WS');
   }
 
@@ -1399,7 +1396,7 @@
 function ws_images_exist($params, $service)
 {
-  ws_logfile(__FUNCTION__.' '.var_export($params, true));
-
-  global $conf;
+  global $conf, $logger;
+
+  $logger->debug(__FUNCTION__, 'WS', $params);
 
   $split_pattern = '/[\s,;\|]/';
@@ -1472,5 +1469,7 @@
 function ws_images_checkFiles($params, $service)
 {
-  ws_logfile(__FUNCTION__.', input :  '.var_export($params, true));
+  global $logger;
+
+  $logger->debug(__FUNCTION__, 'WS', $params);
 
   $query = '
@@ -1510,5 +1509,5 @@
   if (isset($compare_type))
   {
-    ws_logfile(__FUNCTION__.', md5_file($path) = '.md5_file($path));
+    $logger->debug(__FUNCTION__.', md5_file($path) = '.md5_file($path), 'WS');
     if (md5_file($path) != $params[$compare_type.'_sum'])
     {
@@ -1521,5 +1520,5 @@
   }
 
-  ws_logfile(__FUNCTION__.', output :  '.var_export($ret, true));
+  $logger->debug(__FUNCTION__, 'WS', $ret);
 
   return $ret;
