Index: src/daemon/common/commonComplexOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonComplexOptions.ml,v
retrieving revision 1.53
diff -u -u -w -r1.53 commonComplexOptions.ml
--- src/daemon/common/commonComplexOptions.ml	12 May 2006 21:08:30 -0000	1.53
+++ src/daemon/common/commonComplexOptions.ml	19 May 2006 21:58:15 -0000
@@ -30,15 +30,13 @@
 open CommonTypes
 open CommonFile
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[cCO] "
-    (log_time ()); lprintf_nl2
-      
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[cCO] "
-    (log_time ()); lprintf
+let log_prefix = "[cCO]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 (*************************************************************************)
 (*                                                                       *)
@@ -70,12 +68,12 @@
             with _ -> "Donkey" in
           let network = 
             try network_find_by_name network with e ->
-                lprintf_nl ()
+                lprintf_nl
 		  "Error %s for network %s while parsing file %s"
 		    (Printexc2.to_string e)
 		    network
 		    (get_value "file_filename" value_to_string);
-		lprintf_nl () "This core is lacking support for network %s, exiting" network;
+    lprintf_nl "This core is lacking support for network %s, exiting" network;
                 exit_properly 70
           in
           let file_state = 
@@ -106,7 +104,7 @@
             with _ -> ());
           set_file_priority file priority;
 
-          if !verbose then lprintf_nl () "New %s file %s"
+          if !verbose then lprintf_nl "New %s file %s"
 	      (match file_state with
                  FileDownloading -> "downloading"
                | FileDownloaded -> "downloaded"
@@ -268,7 +266,7 @@
           in
           let network = 
             try network_find_by_name network with e ->
-                lprintf_nl () "Network %s not supported" network;
+                lprintf_nl "Network %s not supported" network;
                 raise e
               in
           let server = network_server_of_option network assocs in
@@ -967,13 +965,13 @@
         Options.save_with_help results_ini;
         results =:= [];
     end;
-  lprintf_nl () "Options correctly saved"
+  lprintf_nl "Options correctly saved"
   end
 
 let save_sources () =
   if !allow_saving_ini_files then begin
   networks_iter (fun n -> network_save_sources n);
-  lprintf_nl () "Sources correctly saved"
+  lprintf_nl "Sources correctly saved"
   end
 
 open Zip
@@ -1032,11 +1030,11 @@
 	    (* for whatever reason this error is raised on Windows,
                but fasttrack.ini is stored correctly *)
 	    if !verbose then
-	      lprintf_nl () "Tar: Windows specific pseudo error %s in %s" error arg
+        lprintf_nl "Tar: Windows specific pseudo error %s in %s" error arg
 	  end
 	else begin
 	  failed_files := arg :: !failed_files;
-	  lprintf_nl () "Tar: error %s in %s" error arg
+    lprintf_nl "Tar: error %s in %s" error arg
         end
     ) files);
     if !failed_files <> [] then
@@ -1077,9 +1075,9 @@
           ".zip" -> backup_zip archive files
         | _ -> backup_tar archive files
       end
-    with e -> lprintf_nl () "Exception %s while options backup" (Printexc2.to_string e); raise e
+    with e -> lprintf_nl "Exception %s while options backup" (Printexc2.to_string e); raise e
   end;
-  lprintf_nl () "Options backup as %s correctly saved" format
+  lprintf_nl "Options backup as %s correctly saved" format
              
 let _ =
   CommonBlocking.add_update_hook CommonServer.check_blocked_servers;
@@ -1102,7 +1100,7 @@
     with _ -> ()
   );
   option_hook max_opened_connections (fun _ ->
-  if !verbose then lprintf_nl ()
+  if !verbose then lprintf_nl
     "checking max_opened_connections = %d for validity" !!max_opened_connections;
 (* original code from ./src/config/unix/MlUnix.ml
 let max_all_sockets = getdtablesize ()
@@ -1117,7 +1115,7 @@
   let min_conns = 75 in
 
   if min_conns > !!max_opened_connections then begin
-    lprintf_nl () "max_opened_connections is set too low (%d), raising to %d"
+    lprintf_nl "max_opened_connections is set too low (%d), raising to %d"
       !!max_opened_connections min_conns;
     max_opened_connections =:= min_conns
   end;
@@ -1131,9 +1129,9 @@
   if max_all_sockets < wanted_socks then
     if max_all_sockets < total_files + min_conns then (* check if ulimit is enough to allow total_files + min_conns *)
       begin
-        lprintf_nl () "only %d file descriptors available, raise ulimit open files to at least %d"
+        lprintf_nl "only %d file descriptors available, raise ulimit open files to at least %d"
           max_all_sockets wanted_socks;
-        lprintf_nl () "FD info: max_opened_connections %d, number of (possible) concurrent downloads %d, = %d fd needed"
+        lprintf_nl "FD info: max_opened_connections %d, number of (possible) concurrent downloads %d, = %d fd needed"
           !!max_opened_connections total_files wanted_socks;
         CommonGlobals.exit_properly 71
       end
@@ -1142,12 +1140,12 @@
       let new_max_opened_connections =
         maxi (max_all_sockets - total_files) (max_all_sockets / 2)
       in
-      lprintf_nl () "max_opened_connections is set too high (%d), reducing to %d"
+      lprintf_nl "max_opened_connections is set too high (%d), reducing to %d"
         !!max_opened_connections new_max_opened_connections;
       max_opened_connections =:= new_max_opened_connections;
     end;
 
-  if !verbose then lprintf_nl ()
+  if !verbose then lprintf_nl
     "max_opened_connections %d, total_files %d, max_concurrent_downloads %d, !!files %d"
       !!max_opened_connections total_files !!max_concurrent_downloads (List.length !!files);
 
Index: src/daemon/common/commonFile.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.ml,v
retrieving revision 1.51
diff -u -u -w -r1.51 commonFile.ml
--- src/daemon/common/commonFile.ml	12 May 2006 21:08:30 -0000	1.51
+++ src/daemon/common/commonFile.ml	19 May 2006 21:58:15 -0000
@@ -26,15 +26,13 @@
 open CommonOptions
 open CommonGlobals
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[cF] "
-    (log_time ()); lprintf_nl2
-      
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[cF] "
-    (log_time ()); lprintf
+let log_prefix = "[cF]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 	    
 (*************************************************************************)
 (*                                                                       *)
@@ -163,7 +161,7 @@
 let ni n m =
   let s = Printf.sprintf "File.%s not implemented by %s"
       m n.network_name in
-  lprintf_nl () "%s" s;
+  lprintf_nl "%s" s;
   s
 
 let fni n m = failwith (ni n m)
@@ -258,15 +256,15 @@
   let old_name = file.impl_file_best_name in
   let real_name = Filename2.filesystem_compliant name "" in
   if real_name = "" then
-    lprintf_nl () "can not rename file \"%s\" to \"%s\""
+    lprintf_nl "can not rename file \"%s\" to \"%s\""
       (String.escaped file.impl_file_best_name) (String.escaped real_name)
   else begin
     file.impl_file_best_name <- real_name;
     if name <> real_name then
-      lprintf_nl () "wanted new name \"%s\" changed to \"%s\" due to system limitations"
+      lprintf_nl "wanted new name \"%s\" changed to \"%s\" due to system limitations"
         (String.escaped name) (String.escaped file.impl_file_best_name);
     if !verbose && old_name <> file.impl_file_best_name then
-      lprintf_nl () "best_name of \"%s\" changed to \"%s\""
+      lprintf_nl "best_name of \"%s\" changed to \"%s\""
         (String.escaped old_name) (String.escaped file.impl_file_best_name)
   end
 
@@ -832,40 +830,40 @@
   f
 
 let check_file_implementations () =
-  lprintf_nl () "\n---- Methods not implemented for CommonFile ----";
+  lprintf_nl "\n---- Methods not implemented for CommonFile ----";
   List.iter (fun (c, cc) ->
       let n = c.op_file_network.network_name in
-      lprintf_nl () "\n  Network %s" n; 
+      lprintf_nl "\n  Network %s" n; 
       if c.op_file_to_option == cc.op_file_to_option then 
-        lprintf_nl () "op_file_to_option";
+        lprintf_nl "op_file_to_option";
       if c.op_file_info == cc.op_file_info then
-        lprintf_nl () "op_file_info";
+        lprintf_nl "op_file_info";
       if c.op_file_commit == cc.op_file_commit then
-        lprintf_nl () "op_file_commit";
+        lprintf_nl "op_file_commit";
       if c.op_file_save_as == cc.op_file_save_as then
-        lprintf_nl () "op_file_save_as";
+        lprintf_nl "op_file_save_as";
       if c.op_file_cancel == cc.op_file_cancel then
-        lprintf_nl () "op_file_cancel";
+        lprintf_nl "op_file_cancel";
       if c.op_file_pause == cc.op_file_pause then
-        lprintf_nl () "op_file_pause";
+        lprintf_nl "op_file_pause";
       if c.op_file_resume == cc.op_file_resume then
-        lprintf_nl () "op_file_resume";
+        lprintf_nl "op_file_resume";
 (*      if c.op_file_disk_name == cc.op_file_disk_name then
         lprintf_nl "op_file_disk_name"; *)
       if c.op_file_check == cc.op_file_check then
-        lprintf_nl () "op_file_check";
+        lprintf_nl "op_file_check";
       if c.op_file_recover == cc.op_file_recover then
-        lprintf_nl () "op_file_recover";
+        lprintf_nl "op_file_recover";
       if c.op_file_set_format == cc.op_file_set_format then
-        lprintf_nl () "op_file_set_format";
+        lprintf_nl "op_file_set_format";
       if c.op_file_all_sources == cc.op_file_all_sources then
-        lprintf_nl () "op_file_all_sources";
+        lprintf_nl "op_file_all_sources";
       if c.op_file_active_sources == cc.op_file_active_sources then
-        lprintf_nl () "op_file_active_sources";
+        lprintf_nl "op_file_active_sources";
       if c.op_file_print_html == cc.op_file_print_html then
-        lprintf_nl () "op_file_print_html";
+        lprintf_nl "op_file_print_html";
       if c.op_file_print_sources_html == cc.op_file_print_sources_html then
-        lprintf_nl () "op_file_print_sources_html";
+        lprintf_nl "op_file_print_sources_html";
   ) !files_ops;
   lprint_newline ()
 
@@ -913,7 +911,7 @@
 let file_verify file key begin_pos end_pos =
   Unix32.flush_fd (file_fd file);
   if !verbose_md4 then begin
-      lprintf_nl () "Checksum to compute: %Ld-%Ld of %s" begin_pos end_pos
+      lprintf_nl "Checksum to compute: %Ld-%Ld of %s" begin_pos end_pos
         (file_disk_name file);
     end;
   try
@@ -935,7 +933,7 @@
     in
     let result = computed = key in
     if !verbose_md4 then begin
-        lprintf_nl () "Checksum computed: %s against %s = %s"
+        lprintf_nl "Checksum computed: %s against %s = %s"
           (string_of_uid key) 
         (string_of_uid computed)
         (if result then "VERIFIED" else "CORRUPTED");
@@ -943,7 +941,7 @@
     result
   with
     | Not_found -> raise Not_found
-    | e -> lprintf_nl () "Checksum computation failed: Exception: %s" (Printexc2.to_string e);
+    | e -> lprintf_nl "Checksum computation failed: Exception: %s" (Printexc2.to_string e);
     false
 
 let file_mtime file = Unix32.mtime64 (file_fd file)
Index: src/daemon/common/commonInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonInteractive.ml,v
retrieving revision 1.67
diff -u -u -w -r1.67 commonInteractive.ml
--- src/daemon/common/commonInteractive.ml	8 Apr 2006 01:34:03 -0000	1.67
+++ src/daemon/common/commonInteractive.ml	19 May 2006 21:58:15 -0000
@@ -41,15 +41,13 @@
 open CommonTypes
 open CommonComplexOptions
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[cInt] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[cInt] "
-    (log_time ()); lprintf
+let log_prefix = "[cInt]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 (*************  ADD/REMOVE FUNCTIONS ************)
 let check_forbidden_chars (uc : Charset.uchar) =
@@ -96,7 +94,7 @@
 let all_temp_queued = ref false
 
 let send_dirfull_warning dir line1 =
-  lprintf_nl () "WARNING: Directory %s is full, %s" dir line1;
+  lprintf_nl "WARNING: Directory %s is full, %s" dir line1;
   Printf.fprintf Pervasives.stderr "\nWARNING: Directory %s is full, %s\n" dir line1;
   Pervasives.flush Pervasives.stderr;
   if !!hdd_send_warning_interval <> 0 then
@@ -179,7 +177,7 @@
 	    ("NETWORK",   network.network_name);
 	    ("ED2K_HASH", ed2k_hash)]
   with e -> 
-      lprintf_nl () "Exception %s while executing %s"
+      lprintf_nl "Exception %s while executing %s"
         (Printexc2.to_string e) !!file_completed_cmd
   end
 
@@ -253,7 +251,7 @@
                       incoming.shdir_dirname incoming.shdir_priority
                       best_name new_name);
               with e ->
-                  lprintf_nl () "Exception %s while trying to share commited file"
+                  lprintf_nl "Exception %s while trying to share commited file"
                     (Printexc2.to_string e);
             end;
 
@@ -271,10 +269,10 @@
                   files =:= List2.removeq file !!files;
 
                 with e ->
-                    lprintf_nl () "Exception %s in file_commit secondaries" (Printexc2.to_string e);
+                    lprintf_nl "Exception %s in file_commit secondaries" (Printexc2.to_string e);
             ) secondary_files
         with e ->
-              lprintf_nl () "Exception in file_commit: %s" (Printexc2.to_string e))
+              lprintf_nl "Exception in file_commit: %s" (Printexc2.to_string e))
     | _ -> assert false
 
 let file_cancel file =
@@ -290,20 +288,20 @@
             impl.impl_file_ops.op_file_cancel impl.impl_file_val;
             files =:= List2.removeq file !!files;
           with e ->
-              lprintf_nl () "Exception %s in file_cancel" (Printexc2.to_string e);
+              lprintf_nl "Exception %s in file_cancel" (Printexc2.to_string e);
       ) subfiles;
       try
 	let fd = file_fd file in
 	(try
            Unix32.remove fd
          with e ->
-           lprintf_nl () "Sys.remove %s exception %s"
+           lprintf_nl "Sys.remove %s exception %s"
              (file_disk_name file)
              (Printexc2.to_string e));
 	Unix32.destroy fd
       with Not_found -> ()
   with e ->
-      lprintf_nl () "Exception in file_cancel: %s" (Printexc2.to_string e)
+      lprintf_nl "Exception in file_cancel: %s" (Printexc2.to_string e)
 
 let mail_for_completed_file file =
   if !!mail <> "" then
@@ -365,14 +363,14 @@
         ignore (CommonShared.new_shared "completed" 0 (
             file_best_name file ) file_name);
         (try mail_for_completed_file file with e ->
-              lprintf_nl () "Exception %s in sendmail" (Printexc2.to_string e);
+              lprintf_nl "Exception %s in sendmail" (Printexc2.to_string e);
               );
         if !!CommonOptions.chat_warning_for_downloaded then
           chat_for_completed_file file;
 
       end
   with e ->
-      lprintf_nl () "Exception in file_completed: %s" (Printexc2.to_string e)
+      lprintf_nl "Exception in file_completed: %s" (Printexc2.to_string e)
 
 let file_add impl state =
   try
@@ -394,7 +392,7 @@
         update_file_state impl state
       end
   with e ->
-      lprintf_nl () "[cInt] Exception in file_add: %s" (Printexc2.to_string e)
+      lprintf_nl "[cInt] Exception in file_add: %s" (Printexc2.to_string e)
 
 let server_remove server =
   begin
@@ -411,7 +409,7 @@
         servers =:= Intmap.remove (server_num server) !!servers
       end
   with e ->
-      lprintf_nl () "[cInt] Exception in server_remove: %s" (Printexc2.to_string e)
+      lprintf_nl "[cInt] Exception in server_remove: %s" (Printexc2.to_string e)
 
 let server_add impl =
   let server = as_server impl in
@@ -450,7 +448,7 @@
       end
 
   with e ->
-      lprintf_nl () "Exception in friend_remove: %s" (Printexc2.to_string e)
+      lprintf_nl "Exception in friend_remove: %s" (Printexc2.to_string e)
 
 let contact_add c =
   let impl = as_client_impl c in
@@ -471,7 +469,7 @@
         impl.impl_client_ops.op_client_clear_files impl.impl_client_val
       end
   with e ->
-      lprintf_nl () "Exception in contact_remove: %s" (Printexc2.to_string e)
+      lprintf_nl "Exception in contact_remove: %s" (Printexc2.to_string e)
 
 let exit_counter = ref 0
 let exit_timer = ref false
@@ -814,7 +812,7 @@
        !names
 
 let apply_on_fully_qualified_options name f =
-  if !verbose then lprintf_nl () "Change option %s" name;
+  if !verbose then lprintf_nl "Change option %s" name;
   let rec iter prefix opfile =
     let args = simple_options prefix opfile in
     List.iter (fun o ->
@@ -837,7 +835,7 @@
               false
             with Exit -> true
         )) then begin
-        lprintf_nl () "Could not set option %s" name;
+        lprintf_nl "Could not set option %s" name;
         raise Not_found
       end
   with Exit -> ()
@@ -895,7 +893,7 @@
           | _ -> ()
         end
     | QNone ->
-        lprintf_nl () "start_search: QNone in query";
+        lprintf_nl "start_search: QNone in query";
         ()
   in
   iter query;
Index: src/daemon/common/commonMessages.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonMessages.ml,v
retrieving revision 1.51
diff -u -u -w -r1.51 commonMessages.ml
Index: src/daemon/common/commonServer.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonServer.ml,v
retrieving revision 1.29
diff -u -u -w -r1.29 commonServer.ml
--- src/daemon/common/commonServer.ml	9 May 2006 16:31:37 -0000	1.29
+++ src/daemon/common/commonServer.ml	19 May 2006 21:58:16 -0000
@@ -25,15 +25,13 @@
 open CommonUser
 open CommonTypes
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[cSe] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[cSe] "
-    (log_time ()); lprintf
+let log_prefix = "[cSe]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 module G = GuiTypes
 
@@ -66,7 +64,7 @@
 let ni n m =
   let s = Printf.sprintf "Server.%s not implemented by %s"
       m n.network_name in
-  lprintf_nl () "%s" s;
+  lprintf_nl "%s" s;
   s
 
 let fni n m =  failwith (ni n m)
@@ -226,36 +224,36 @@
   s
 
 let check_server_implementations () =
-  lprintf_nl () "----- Methods not implemented for CommonServer ----";
+  lprintf_nl "----- Methods not implemented for CommonServer ----";
   List.iter (fun (c, cc) ->
       let n = c.op_server_network.network_name in
-      lprintf_nl ()"  Network %s" n;
+      lprintf_nl "  Network %s" n;
       if c.op_server_remove == cc.op_server_remove then
-        lprintf_nl () "op_server_remove";
+        lprintf_nl "op_server_remove";
       if c.op_server_to_option == cc.op_server_to_option then
-        lprintf_nl () "op_server_to_option";
+        lprintf_nl "op_server_to_option";
       if c.op_server_info == cc.op_server_info then
-        lprintf_nl () "op_server_info";
+        lprintf_nl "op_server_info";
       if c.op_server_sort == cc.op_server_sort then
-        lprintf_nl () "op_server_sort";
+        lprintf_nl "op_server_sort";
       if c.op_server_connect == cc.op_server_connect then
-        lprintf_nl () "op_server_connect";
+        lprintf_nl "op_server_connect";
       if c.op_server_disconnect == cc.op_server_disconnect then
-        lprintf_nl () "op_server_disconnect";
+        lprintf_nl "op_server_disconnect";
       if c.op_server_find_user == cc.op_server_find_user then
-        lprintf_nl () "op_server_find_user";
+        lprintf_nl "op_server_find_user";
       if c.op_server_query_users == cc.op_server_query_users then
-        lprintf_nl () "op_server_query_users";
+        lprintf_nl "op_server_query_users";
       if c.op_server_users == cc.op_server_users then
-        lprintf_nl () "op_server_users";
+        lprintf_nl "op_server_users";
       if c.op_server_cid == cc.op_server_cid then
-        lprintf_nl () "op_server_cid";
+        lprintf_nl "op_server_cid";
       if c.op_server_low_id == cc.op_server_low_id then
-        lprintf_nl () "op_server_low_id";
+        lprintf_nl "op_server_low_id";
       if c.op_server_rename == cc.op_server_rename then
-        lprintf_nl () "op_server_rename";
+        lprintf_nl "op_server_rename";
       if c.op_server_set_preferred == cc.op_server_set_preferred then
-        lprintf_nl () "op_server_set_preferred";
+        lprintf_nl "op_server_set_preferred";
   ) !servers_ops;
   lprint_newline ()
 
@@ -330,21 +328,21 @@
           (match impl.impl_server_state with
              NotConnected _ -> ()
          | _ -> server_disconnect s;
-              lprintf_nl () "Disconnected server %s (%s:%d), IP is now blocked"
+              lprintf_nl "Disconnected server %s (%s:%d), IP is now blocked"
                 info.G.server_name
                 (Ip.string_of_addr info.G.server_addr)
                 info.G.server_port);
       end;
       server_must_update s)
   with e ->
-    lprintf_nl () "Exception in check_blocked_servers: %s" (Printexc2.to_string e)
+    lprintf_nl "Exception in check_blocked_servers: %s" (Printexc2.to_string e)
 
 let server_must_update_all () =
   try
     server_iter (fun s ->
       server_must_update s)
   with e ->
-    lprintf_nl () "Exception in server_must_update_all: %s" (Printexc2.to_string e)
+    lprintf_nl "Exception in server_must_update_all: %s" (Printexc2.to_string e)
 
 let server_banner s o =
   let buf = o.conn_buf in
@@ -380,7 +378,7 @@
   try
     let info =
       try server_info s with e ->
-          lprintf_nl () "Exception %s in server_info (%s)\n"
+          lprintf_nl "Exception %s in server_info (%s)\n"
             (Printexc2.to_string e) n.network_name;
           raise e in
 
@@ -529,5 +527,5 @@
       end;
 
   with e ->
-      lprintf_nl () "Exception %s in CommonServer.server_print"
+      lprintf_nl "Exception %s in CommonServer.server_print"
         (Printexc2.to_string e)
Index: src/daemon/common/commonShared.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonShared.ml,v
retrieving revision 1.31
diff -u -u -w -r1.31 commonShared.ml
--- src/daemon/common/commonShared.ml	12 May 2006 21:08:30 -0000	1.31
+++ src/daemon/common/commonShared.ml	19 May 2006 21:58:16 -0000
@@ -80,9 +80,10 @@
 let fni  n m =  failwith (ni n m)
 let ni_ok n m = ignore (ni n m)
 
-let lprintf_nl () =
-  lprintf "%s[cSha] "
-  (log_time ()); lprintf_nl2
+let log_prefix = "[cSha]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
     
 let shared_calculate_total_bytes () =
   nshared_bytes := Int64.zero;
@@ -107,7 +108,7 @@
 let update_shared_num impl =
   if impl.impl_shared_num = 0 then begin
       if !verbose_share then
-          lprintf_nl () "NEW SHARED %s/%s" impl.impl_shared_codedname
+          lprintf_nl "NEW SHARED %s/%s" impl.impl_shared_codedname
             impl.impl_shared_fullname; 
       incr shared_counter;
       impl.impl_shared_num <- !shared_counter;
@@ -143,13 +144,13 @@
         name in
   let codedname = Filename.concat dirname filename in
   if !verbose_share then
-    lprintf_nl () "sharing %s" fullname;
+    lprintf_nl "sharing %s" fullname;
   let size = Unix32.getsize fullname in
   incr files_scanned;
   files_scanned_size := !files_scanned_size ++ size;
   if Unix2.is_directory fullname then begin
     if !verbose_share then
-      lprintf_nl () "new_shared: %s is directory! Skipped network.share" fullname;
+      lprintf_nl "new_shared: %s is directory! Skipped network.share" fullname;
   end
   else begin
   CommonNetwork.networks_iter (fun n -> 
@@ -250,7 +251,7 @@
   if can_share dirname then
     try
       let files = Unix2.list_directory full_dir in
-      if !verbose_share then lprintf_nl () "Sharing sub-directory %s" full_dir; 
+      if !verbose_share then lprintf_nl "Sharing sub-directory %s" full_dir; 
       List.iter (fun file ->
           if file <> "" && file.[0] <> '.' then
             let full_name = Filename.concat full_dir file in
@@ -262,13 +263,13 @@
 	          begin
 		    let inode = ((Unix.stat full_name).Unix.st_ino) in
 		      if inode = incoming_files_inode then
-		        if !verbose_share then lprintf_nl () "avoid sharing incoming_files %s" full_dir else ()
+            if !verbose_share then lprintf_nl "avoid sharing incoming_files %s" full_dir else ()
 		      else
 		        if inode = incoming_directories_inode then
-			  if !verbose_share then lprintf_nl () "avoid sharing incoming_directories %s" full_dir else ()
+        if !verbose_share then lprintf_nl "avoid sharing incoming_directories %s" full_dir else ()
 			else
 			  if inode = temp_directory_inode then
-			    if !verbose_share then lprintf_nl () "avoid sharing temp %s" full_dir else ()
+          if !verbose_share then lprintf_nl "avoid sharing temp %s" full_dir else ()
 			  else
 			    shared_add_directory shared_dir local_name
                   end
@@ -288,15 +289,15 @@
                   new_shared dirname shared_dir.shdir_priority
                     local_name full_name
               with e -> 
-                  lprintf_nl () "%s will not be shared (exception %s)"
+                  lprintf_nl "%s will not be shared (exception %s)"
                     full_name (Printexc2.to_string e);
             with _ -> ()
       ) files
     with e -> 
-        lprintf_nl () "Exception %s while sharing %s"
+        lprintf_nl "Exception %s while sharing %s"
            (Printexc2.to_string e) full_dir
   else 
-    lprintf_nl () "Cannot share %s" full_dir
+    lprintf_nl "Cannot share %s" full_dir
 
 let _ = 
   BasicSocket.add_infinite_timer 1. (fun _ ->
@@ -313,7 +314,7 @@
     
 let shared_add_directory shared_dir =
   if shared_dir.shdir_dirname <> "" then begin
-      if !verbose_share then lprintf_nl () "Sharing %s prio %d" shared_dir.shdir_dirname
+      if !verbose_share then lprintf_nl "Sharing %s prio %d" shared_dir.shdir_dirname
         shared_dir.shdir_priority;
       shared_add_directory shared_dir ""
     end
Index: src/daemon/common/commonSwarming.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonSwarming.ml,v
retrieving revision 1.32
diff -u -u -w -r1.32 commonSwarming.ml
--- src/daemon/common/commonSwarming.ml	14 May 2006 18:54:17 -0000	1.32
+++ src/daemon/common/commonSwarming.ml	19 May 2006 21:58:17 -0000
@@ -53,15 +53,13 @@
 (* let debug_all = true *)
 let exit_on_error = ref false
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[cSw2] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[cSw2] "
-    (log_time ()); lprintf
+let log_prefix = "[cSw]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 open CommonTypes
 
@@ -276,10 +274,10 @@
 (** (debug) output an [uploader] to current log *)
 
 let print_uploader up =
-  lprintf_n () "  interesting complete_blocks: %d\n     " up.up_ncomplete;
+  lprintf_n "  interesting complete_blocks: %d\n     " up.up_ncomplete;
   Array.iter (fun i -> lprintf " %d " i) up.up_complete_blocks;
   lprint_newline ();
-  lprintf_n () "  interesting partial_blocks: %d\n     " up.up_npartial;
+  lprintf_n "  interesting partial_blocks: %d\n     " up.up_npartial;
   Array.iter (fun (i, begin_pos, end_pos) ->
       lprintf " %d[%Ld...%Ld] " i begin_pos end_pos
   ) up.up_partial_blocks;
@@ -426,7 +424,7 @@
       r.range_current_begin <- min r.range_current_begin cut_pos;
 
       if r.range_nuploading <> 0 then
-	lprintf_n () "WARNING: Splitting a range currently being uploaded, don't know what to do with range_nuploaders :/\n";
+  lprintf_n "WARNING: Splitting a range currently being uploaded, don't know what to do with range_nuploaders :/\n";
 
       split_r in
   let cut_ranges = iter r in
@@ -554,9 +552,9 @@
     aux 0 in
 
   if array_exist ((<>) 0) s.s_availability then
-    lprintf_nl () "WARNING: splitting swarmer discarded availability counters\n";
+    lprintf_nl "WARNING: splitting swarmer discarded availability counters\n";
   if array_exist ((<>) 0) s.s_nuploading then
-    lprintf_nl () "WARNING: splitting a swarmer beging uploaded to\n";
+    lprintf_nl "WARNING: splitting a swarmer beging uploaded to\n";
 
   s.s_blocks <- Array.create nblocks EmptyBlock;
   s.s_verified_bitmap <- String.make nblocks '0';
@@ -593,7 +591,7 @@
 (* what about raising an exception instead ? *)
   if s.s_size <> size then
     begin
-      lprintf_nl () "file_size for %s does not match: swarmer %Ld / real %Ld" s.s_filename s.s_size size;
+      lprintf_nl "file_size for %s does not match: swarmer %Ld / real %Ld" s.s_filename s.s_size size;
       exit 2
     end;
 
@@ -745,7 +743,7 @@
   in
   let i = iter 0 (Array.length b - 1) in
   if debug_all then
-    lprintf_nl () "%Ld is block %d [%Ld-%Ld]" chunk_pos i
+    lprintf_nl "%Ld is block %d [%Ld-%Ld]" chunk_pos i
       (compute_block_begin s i) (compute_block_end s i);
   i
 
@@ -777,7 +775,7 @@
                 let current_end =  min block_end chunk_end in
 
                 if debug_all then
-                  lprintf_nl () "Apply: %d %Ld-%Ld %Ld-%Ld"
+                  lprintf_nl "Apply: %d %Ld-%Ld %Ld-%Ld"
                     i block_begin block_end chunk_begin current_end;
 
                 f i block_begin block_end chunk_begin current_end;
@@ -798,10 +796,10 @@
 (*************************************************************************)
 
 let print_s str s =
-  lprintf_nl () "Ranges after %s:" str;
+  lprintf_nl "Ranges after %s:" str;
 
   let rec iter r =
-    lprintf_n () " %Ld(%Ld)-%Ld(%d)"
+    lprintf_n " %Ld(%Ld)-%Ld(%d)"
       r.range_begin r.range_current_begin r.range_end r.range_nuploading;
     match r.range_next with
       None -> lprint_newline()
@@ -809,7 +807,7 @@
   in
 
   Array.iteri (fun i b ->
-      lprintf_n () "   %d: " i;
+      lprintf_n "   %d: " i;
       let block_begin = compute_block_begin s i in
       let block_end = compute_block_end s i in
       lprintf "%Ld - %Ld [%Ld] %c " block_begin block_end
@@ -826,17 +824,17 @@
           lprintf " [%Ld .. %Ld] --> "
             b.block_begin b.block_end;
           iter b.block_ranges
-      | EmptyBlock -> lprintf_nl2 "_"
-      | CompleteBlock -> lprintf_nl2 "C"
-      | VerifiedBlock -> lprintf_nl2 "V"
+      | EmptyBlock -> lprintf_nl "_"
+      | CompleteBlock -> lprintf_nl "C"
+      | VerifiedBlock -> lprintf_nl "V"
   ) s.s_blocks;
 
-  lprintf_nl () "Files:";
+  lprintf_nl "Files:";
   List.iter (fun t ->
-      lprintf_nl () "  File num: %d" (file_num t.t_file);
-      lprintf_nl () "  %s" (if t.t_primary then "primary" else "secondary");
-      lprintf_nl () "  Downloaded: %Ld" (file_downloaded t.t_file);
-      lprintf_nl () "  Bitmap: %s" t.t_converted_verified_bitmap
+      lprintf_nl "  File num: %d" (file_num t.t_file);
+      lprintf_nl "  %s" (if t.t_primary then "primary" else "secondary");
+      lprintf_nl "  Downloaded: %Ld" (file_downloaded t.t_file);
+      lprintf_nl "  Bitmap: %s" t.t_converted_verified_bitmap
   ) s.s_networks
 
 (*************************************************************************)
@@ -861,12 +859,12 @@
 (*************************************************************************)
 
 let print_block b =
-  lprintf_n () "Block %d: %Ld-%Ld"
+  lprintf_n "Block %d: %Ld-%Ld"
     b.block_num b.block_begin b.block_end;
   lprint_newline ();
-  lprintf_nl () "  ranges:";
+  lprintf_nl "  ranges:";
   let rec iter_range r =
-    lprintf_nl () "   %Ld-%Ld" r.range_current_begin r.range_end;
+    lprintf_nl "   %Ld-%Ld" r.range_current_begin r.range_end;
     match r.range_next with
       None -> ()
     | Some rr -> iter_range rr
@@ -893,7 +891,7 @@
         | _ -> ()
       end;
       if file_downloaded t.t_file < zero then
-          lprintf_nl () "ERROR: file_downloaded < zero!";
+          lprintf_nl "ERROR: file_downloaded < zero!";
 
   | _ -> ()
 
@@ -1121,7 +1119,7 @@
                 set_verified_chunk t i;
                 t.t_verified t.t_nverified_blocks i;
                 if !verbose_swarming || !verbose then
-		  lprintf_nl () "Completed block %d/%d of %s"
+      lprintf_nl "Completed block %d/%d of %s"
                     (i + 1) t.t_nchunks (file_best_name t.t_file)
               end
 	    else
@@ -1134,7 +1132,7 @@
 		then
 		  begin
 		    if !verbose_swarming || !verbose then
-                      lprintf_nl () "Complete block %d/%d of %s failed verification, reloading..."
+                      lprintf_nl "Complete block %d/%d of %s failed verification, reloading..."
                             (i + 1) t.t_nchunks (file_best_name t.t_file);
 
                     t.t_converted_verified_bitmap.[i] <- '0';
@@ -1158,12 +1156,12 @@
 		  begin
 		    if !verbose_swarming then begin
                       let nsub = ref 0 in
-                        lprintf_n () "  Swarmer was incomplete: ";
+                        lprintf_n "  Swarmer was incomplete: ";
                         List.iter (fun i ->
                           lprintf "%c" s.s_verified_bitmap.[i];
                           if s.s_verified_bitmap.[i] = '2' then incr nsub;
                         ) t.t_blocks_of_chunk.(i);
-                        lprintf_nl2 "   = %d/%d" !nsub (List.length t.t_blocks_of_chunk.(i))
+                        lprintf_nl "   = %d/%d" !nsub (List.length t.t_blocks_of_chunk.(i))
 		    end;
                     t.t_converted_verified_bitmap.[i] <- '1'
                   end;
@@ -1193,7 +1191,7 @@
 
               end else begin
 
-                lprintf_nl () "Verification of blocks for file %s FAILED\n"
+                lprintf_nl "Verification of blocks for file %s FAILED\n"
                     (file_best_name t.t_file);
 
                   for i = 0 to nblocks - 1 do
@@ -1223,12 +1221,12 @@
                           end else begin
                             let nsub = ref 0 in
 
-                            lprintf_n () "  Swarmer was incomplete: ";
+                            lprintf_n "  Swarmer was incomplete: ";
                             List.iter (fun i ->
                                 lprintf "%c" s.s_verified_bitmap.[i];
                                 if s.s_verified_bitmap.[i] = '2' then incr nsub;
                                 ) t.t_blocks_of_chunk.(i);
-                            lprintf_nl2 "   = %d/%d" !nsub (List.length t.t_blocks_of_chunk.(i));
+                            lprintf_nl "   = %d/%d" !nsub (List.length t.t_blocks_of_chunk.(i));
 
                             t.t_converted_verified_bitmap.[i] <- '1'
                           end;
@@ -1389,7 +1387,7 @@
   s.s_blocks.(i) <- PartialBlock b;
   if s.s_verified_bitmap.[i] < '1' then
     set_bitmap_1 s i;
-  if debug_all then lprintf_nl () "NB[%s]" s.s_verified_bitmap;
+  if debug_all then lprintf_nl "NB[%s]" s.s_verified_bitmap;
   b
 
 
@@ -1494,7 +1492,7 @@
 (*    lprintf "iter range %Ld-%Ld\n" r.range_begin r.range_end; *)
     (try range_received None r chunk_begin chunk_end
       with e ->
-          lprintf_nl () "EXCEPTION IN range_received: %s"
+          lprintf_nl "EXCEPTION IN range_received: %s"
             (Printexc2.to_string e);
           exit 2);
     match range_next with
@@ -1666,7 +1664,7 @@
     up.up_ncomplete <- Array.length complete_blocks;
 
     if Array.length partial_blocks > 0 then
-      lprintf_nl () "WARNING: partial_blocks = %d" (Array.length partial_blocks);
+      lprintf_nl "WARNING: partial_blocks = %d" (Array.length partial_blocks);
     up.up_partial_blocks <- partial_blocks;
     up.up_npartial <- Array.length partial_blocks;
 
@@ -1830,10 +1828,10 @@
   | PartialBlock b ->
       b, b.block_begin, b.block_end
   | VerifiedBlock ->
-      lprintf_nl () "ERROR: verified block in permute_and_return %d\n" b;
+      lprintf_nl "ERROR: verified block in permute_and_return %d\n" b;
       assert false
   | CompleteBlock ->
-      lprintf_nl () "ERROR: complete block in permute_and_return %d\n" b;
+      lprintf_nl "ERROR: complete block in permute_and_return %d\n" b;
       assert false
 
 (*************************************************************************)
@@ -1921,7 +1919,7 @@
 
 let random_int max =
   let x = Random.int max in
-  if debug_all then lprintf_nl () "(Random %d -> %d)" max x;
+  if debug_all then lprintf_nl "(Random %d -> %d)" max x;
   x
 
 let select_block up =
@@ -1959,7 +1957,7 @@
 (*************   Try to download the movie index and the first minute to
    allow preview of the file as soon as possible *)
 
-                if debug_all then lprintf_nl () "{First}";
+                if debug_all then lprintf_nl "{First}";
 
                 let download_first n b =
 (*                lprintf "download_first %d\n" n; *)
@@ -1993,7 +1991,7 @@
 (************* If the file can be verified, and we don't have a lot of blocks
     yet, try to download the partial ones as soon as possible *)
 
-                if debug_all then lprintf_nl () "{PartialBlock}";
+                if debug_all then lprintf_nl "{PartialBlock}";
 
                 let download_partial max_uploaders =
                   let partial_block = ref (-1) in
@@ -2024,7 +2022,7 @@
 (************* Download partial chunks from the verification point of view *)
 
                 if List.length s.s_networks > 1 then begin
-                    if debug_all then lprintf_n () "{PartialChunk}";
+                    if debug_all then lprintf_n "{PartialChunk}";
 
                     let my_t = if t.t_verifier <> NoVerification then t
                       else match s.s_networks with t :: _ -> t | _ -> t in
@@ -2045,7 +2043,7 @@
                         let b = should_download_block s n in
 
                         if !verbose_swarming then
-                            lprintf_nl2 "  test %d %c %d %b %d"
+                            lprintf_nl "  test %d %c %d %b %d"
                               n s.s_verified_bitmap.[n] s.s_nuploading.(n)
                             b nbs;
 
@@ -2062,7 +2060,7 @@
                       done;
                       if !partial_block <> -1 then begin
                           if !verbose_swarming then
-                            lprintf_n () "PartialChunk won for %d waiting blocks"
+                            lprintf_n "PartialChunk won for %d waiting blocks"
                               !partial_remaining;
                           raise (BlockFound !partial_block)
                         end
@@ -2183,7 +2181,7 @@
         if debug_all then lprintf " = %d \n" num;
         b
   with e ->
-      if debug_all then lprintf_nl () "Exception %s" (Printexc2.to_string e);
+      if debug_all then lprintf_nl "Exception %s" (Printexc2.to_string e);
       raise e
 
 (*************************************************************************)
@@ -2278,7 +2276,7 @@
             up.up_ranges <- up.up_ranges @ [key];
             r.range_nuploading <- r.range_nuploading + 1;
             if r.range_current_begin = r.range_end then
-              lprintf_nl () "error: range is empty error";
+              lprintf_nl "error: range is empty error";
             key
           end else
         match r.range_next with
@@ -2313,7 +2311,7 @@
     let file_end = file_begin ++ (Int64.of_int string_len) in
 
     if !verbose_swarming then
-      lprintf_nl () "received on %Ld-%Ld" file_begin file_end;
+      lprintf_nl "received on %Ld-%Ld" file_begin file_end;
 
 (* TODO: check that everything we received has been required *)
     let t = up.up_t in
@@ -2344,13 +2342,13 @@
                       string_len < string_length then begin
                         if !verbose then
                         begin
-                        lprintf_nl () "BAD WRITE in %s for range %Ld-%Ld (string_pos %d)"
+                        lprintf_nl "BAD WRITE in %s for range %Ld-%Ld (string_pos %d)"
                           (file_best_name t.t_file) r.range_begin r.range_end string_pos;
-                        lprintf_nl () "  received: file_pos:%Ld string:%d %d"
+                        lprintf_nl "  received: file_pos:%Ld string:%d %d"
                           file_begin string_begin string_len;
-                        lprintf_nl () "  ranges:";
+                        lprintf_nl "  ranges:";
                         List.iter (fun (_,_,r) ->
-                            lprintf_n () "     range: %Ld-[%Ld]-%Ld"
+                            lprintf_n "     range: %Ld-[%Ld]-%Ld"
                               r.range_begin r.range_current_begin
                               r.range_end;
                             (match r.range_next with
@@ -2363,7 +2361,7 @@
                                   lprintf "  prev: %Ld" rr.range_begin);
                             lprint_newline ();
                             let b = r.range_block in
-                            lprintf_n () "        block: %d[%c] %Ld-%Ld [%s]"
+                            lprintf_n "        block: %d[%c] %Ld-%Ld [%s]"
                               b.block_num
                               s.s_verified_bitmap.[b.block_num]
                               b.block_begin b.block_end
@@ -2412,7 +2410,7 @@
 
   let rec iter_block_out i block_begin list =
     if debug_present_chunks then
-      lprintf_nl () "iter_block_out %d bb: %Ld"
+      lprintf_nl "iter_block_out %d bb: %Ld"
         i block_begin;
 
     if i = nblocks then List.rev list else
@@ -2428,7 +2426,7 @@
 
   and iter_block_in i block_begin chunk_begin list =
     if debug_present_chunks then
-      lprintf_nl () "iter_block_in %d bb: %Ld cb:%Ld"
+      lprintf_nl "iter_block_in %d bb: %Ld cb:%Ld"
         i block_begin chunk_begin
       ;
 
@@ -2448,7 +2446,7 @@
 
   and iter_range_out i block_end block_begin r list =
     if debug_present_chunks then
-      lprintf_nl () "iter_range_out %d nb: %Ld bb:%Ld"
+      lprintf_nl "iter_range_out %d nb: %Ld bb:%Ld"
         i block_end block_begin;
 
     if r.range_begin > block_begin then
@@ -2480,7 +2478,7 @@
 
   and iter_range_in i block_end chunk_begin chunk_end r list =
     if debug_present_chunks then
-      lprintf_nl () "iter_range_in %d bn: %Ld cb:%Ld ce: %Ld"
+      lprintf_nl "iter_range_in %d bn: %Ld cb:%Ld ce: %Ld"
         i block_end chunk_begin chunk_end;
 
     if r.range_current_begin < r.range_end then
@@ -2629,7 +2627,7 @@
                   ()
           ) t.t_blocks_of_chunk.(i);
           if t.t_converted_verified_bitmap.[i] <> '3' then
-            lprintf_nl () "FIELD AS BEEN CLEARED"
+            lprintf_nl "FIELD AS BEEN CLEARED"
     | _ -> ()
   done
 
@@ -2798,7 +2796,7 @@
             (get_value  "file_all_chunks" value_to_string)
 
     with e ->
-        lprintf_nl () "Exception %s while loading bitmap"
+        lprintf_nl "Exception %s while loading bitmap"
           (Printexc2.to_string e);
   );
 
@@ -2808,7 +2806,7 @@
 *)
 
   if primary then begin
-      if !verbose_swarming then lprintf_nl () "Loading present...";
+      if !verbose_swarming then lprintf_nl "Loading present...";
       let present = try
           let present =
             (get_value "file_present_chunks"
@@ -2817,46 +2815,46 @@
           set_present t present;
           present
         with e ->
-            lprintf_nl () "Exception %s while set present"
+            lprintf_nl "Exception %s while set present"
               (Printexc2.to_string e);
             []
       in
-      if !verbose_swarming then lprintf_nl () "Downloaded after present %Ld" (downloaded t);
+      if !verbose_swarming then lprintf_nl "Downloaded after present %Ld" (downloaded t);
 
 (*
-      if !verbose then lprintf_nl () "Loading absent...";
+      if !verbose then lprintf_nl "Loading absent...";
       (try
           set_absent t
             (get_value "file_absent_chunks"
               (value_to_list value_to_int64_pair));
         with e ->
-            if !verbose_hidden_errors then lprintf_nl () "Exception %s while set absent"
+            if !verbose_hidden_errors then lprintf_nl "Exception %s while set absent"
               (Printexc2.to_string e);
       );
-      if !verbose then lprintf_nl () "Downloaded after absent %Ld" (downloaded t);
+      if !verbose then lprintf_nl "Downloaded after absent %Ld" (downloaded t);
 *)
       (try
           let d = get_value "file_downloaded" value_to_int64 in
 
           if d <> downloaded t && !verbose then begin
-              lprintf_nl () "ERROR: stored downloaded value not restored  !!! (%Ld/%Ld)" (downloaded t) d;
-              lprintf_nl () "ERROR: present:";
+              lprintf_nl "ERROR: stored downloaded value not restored  !!! (%Ld/%Ld)" (downloaded t) d;
+              lprintf_nl "ERROR: present:";
               List.iter (fun (x,y) ->
-                  lprintf_nl () "     (%Ld,%Ld);" x y
+                  lprintf_nl "     (%Ld,%Ld);" x y
               ) present;
 
               let p = present_chunks t in
-              lprintf_nl () "ERROR: present now:";
+              lprintf_nl "ERROR: present now:";
 
               let total = ref zero in
               List.iter (fun (x,y) ->
-                  lprintf_nl () "     (%Ld,%Ld);" x y;
+                  lprintf_nl "     (%Ld,%Ld);" x y;
                   total := !total ++ (y -- x);
               ) p;
 
-              lprintf_nl () "ERROR: total %Ld" !total;
+              lprintf_nl "ERROR: total %Ld" !total;
               if p = present then begin
-                  lprintf_nl () "ERROR: both appear to be the same!";
+                  lprintf_nl "ERROR: both appear to be the same!";
                 end;
         if !exit_on_error then exit 2
             end
@@ -2968,7 +2966,7 @@
   let t2 = match s2.s_networks with
       [t] -> t
     | list ->
-        lprintf_nl () "s_networks: %d files" (List.length list);
+        lprintf_nl "s_networks: %d files" (List.length list);
         failwith "Second file is already merged with other files"
   in
 
@@ -3016,7 +3014,7 @@
     None -> () 
   | Some sw -> if not (has_secondaries sw)
                 then HS.remove swarmers_by_name sw.t_s
-                else lprintf_nl () "Tried to remove swarmer with secondaries"
+                else lprintf_nl "Tried to remove swarmer with secondaries"
 
 (*************************************************************************)
 (*                                                                       *)
@@ -3215,7 +3213,7 @@
           if bitmap.[i] <> '3' then raise Not_found;
         done;
         if file_size file <> downloaded t then
-          lprintf_nl () "Downloaded size differs after complete verification";
+          lprintf_nl "Downloaded size differs after complete verification";
         true
   with _ -> false
 
Index: src/daemon/common/commonUploads.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonUploads.ml,v
retrieving revision 1.42
diff -u -u -w -r1.42 commonUploads.ml
--- src/daemon/common/commonUploads.ml	12 May 2006 21:08:30 -0000	1.42
+++ src/daemon/common/commonUploads.ml	19 May 2006 21:58:17 -0000
@@ -33,15 +33,13 @@
 open CommonGlobals
 open CommonOptions
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[cUp] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[cUp] "
-    (log_time ()); lprintf
+let log_prefix = "[cUp]"
+
+let lprintf_nl fmt = 
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 (*
 PROBLEMS: most of the time, users won't share their files on all networks.
@@ -449,7 +447,7 @@
             CommonHasher.compute_sha1 (Unix32.filename sh.shared_fd)
             zero info.shared_size (fun job ->
                 if job.CommonHasher.job_error then begin
-                    lprintf_nl () "Error during hashing of %s" info.shared_fullname;
+                    lprintf_nl "Error during hashing of %s" info.shared_fullname;
                     current_job := None;
                   end else
                   begin
@@ -537,7 +535,7 @@
                 pos (min (size -- pos) chunk_size)
               (fun job ->
                   if job.CommonHasher.job_error then begin
-                      lprintf_nl () "Error during hashing of %s" info.shared_fullname;
+                      lprintf_nl "Error during hashing of %s" info.shared_fullname;
                       current_job := None;
                     end else begin
 
@@ -571,7 +569,7 @@
                   pos (min (size -- pos) chunk_size)
               (fun job ->
                     if job.CommonHasher.job_error then begin
-                      lprintf_nl () "Error during hashing of %s"
+                      lprintf_nl "Error during hashing of %s"
                       info.shared_fullname;
                         current_job := None;
                       end else begin
@@ -608,7 +606,7 @@
             [] ->  waiting_shared_files := tail;
           | uid :: tail ->
               if !verbose_share then
-                lprintf_nl () "shared_files_timer: starting job";
+                lprintf_nl "shared_files_timer: starting job";
               sh.shared_uids_wanted <- tail;
               current_job := Some sh;
               start_job_for sh uid
@@ -829,7 +827,7 @@
 
 let add_pending_slot c =
   if client_has_a_slot c then begin
-      if !verbose_upload then lprintf_nl () "Avoided inserting an uploader in pending slots!"
+      if !verbose_upload then lprintf_nl "Avoided inserting an uploader in pending slots!"
     end
   else
   if not (Intmap.mem (client_num c) !pending_slots_map) then
@@ -912,7 +910,7 @@
   let open_slots n =
     let i = ref n in
     if !verbose_upload then
-      lprintf_nl () "try to allocate %d more slots" n;
+      lprintf_nl "try to allocate %d more slots" n;
     while !i > 0 do
       find_pending_slot ();
       decr i
@@ -927,7 +925,7 @@
     (* max_hard_upload_rate lowered manually,... *)
     mini estimated_capacity (!!max_hard_upload_rate * 1024) in
   if !verbose_upload then
-    lprintf_nl () "usage: %d(%d) capacity: %d"
+    lprintf_nl "usage: %d(%d) capacity: %d"
       (short_delay_upload_usage ())
       (upload_usage ())
       estimated_capacity;
@@ -937,13 +935,13 @@
 (* enough free bw for another slot *)
     if short_delay_upload_usage () + slot_bw < estimated_capacity then begin
       if !verbose_upload then
-	lprintf_nl () "uplink not fully used";
+  lprintf_nl "uplink not fully used";
       incr not_saturated_count
     end else reset_state ();
 
     if len < min_upload_slots then begin
       if !verbose_upload then
-	lprintf_nl () "too few upload slots";
+  lprintf_nl "too few upload slots";
       open_slots (min_upload_slots - len);
       reset_state ()
     end else if !not_saturated_count >= 2 then begin
@@ -1023,10 +1021,10 @@
 let upload_download_timer () =
   (try download_engine ()
     with e ->
-        lprintf_nl () "Exception %s in download_engine" (Printexc2.to_string e)
+        lprintf_nl "Exception %s in download_engine" (Printexc2.to_string e)
   );
   (try next_uploads ()
-  with e -> lprintf_nl () "exc %s in upload" (Printexc2.to_string e))
+  with e -> lprintf_nl "exc %s in upload" (Printexc2.to_string e))
 
 let words_of_filename =
   let extension_list = [
@@ -1049,7 +1047,7 @@
   let get_name_keywords file_name =
     match remove_short (String2.stem file_name) [] with
       [] | [_] ->
-        lprintf_nl () "Not enough keywords to recover %s" file_name;
+        lprintf_nl "Not enough keywords to recover %s" file_name;
         [file_name]
     | l -> l
   in
Index: src/daemon/common/commonUserDb.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonUserDb.ml,v
retrieving revision 1.3
diff -u -u -w -r1.3 commonUserDb.ml
--- src/daemon/common/commonUserDb.ml	17 Mar 2006 18:33:16 -0000	1.3
+++ src/daemon/common/commonUserDb.ml	19 May 2006 21:58:17 -0000
@@ -23,15 +23,13 @@
 open CommonTypes
 open CommonOptions
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[cUd] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[cUd] "
-    (log_time ()); lprintf
+let log_prefix = "[cUd]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 type userdb = {
     user_name : string;
@@ -152,7 +150,7 @@
       ) !!userlist;
       userlist =:= [];
       if !!users <> [] then begin
-        lprintf_nl () "converting %d users to new format" (List.length !!users);
+        lprintf_nl "converting %d users to new format" (List.length !!users);
         List.iter (fun (user,pass) -> ignore (user2_add user pass "")) !!users;
 	users =:= []
       end
Index: src/daemon/driver/driverCommands.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverCommands.ml,v
retrieving revision 1.143
diff -u -u -w -r1.143 driverCommands.ml
--- src/daemon/driver/driverCommands.ml	18 May 2006 17:28:44 -0000	1.143
+++ src/daemon/driver/driverCommands.ml	19 May 2006 21:58:18 -0000
@@ -49,9 +49,13 @@
 open Gettext
 open Autoconf
 
-let lprintf_nl () =
-  lprintf "%s"
-    (log_time ()); lprintf_nl2
+let log_prefix = "[dCmd]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let _s x = _s "DriverCommands" x
 let _b x = _b "DriverCommands" x
@@ -2875,19 +2879,19 @@
         set_logging b;
 	if b then
 	  begin
-	    lprintf_nl () "Enable logging to stdout...";
+      lprintf_nl "Enable logging to stdout...";
 	    log_to_file stdout;
-	    lprintf_nl () "Logging to stdout..."
+      lprintf_nl "Logging to stdout..."
 	  end
 	else
 	  begin
-	    lprintf_nl () "Disable logging to stdout...";
+      lprintf_nl "Disable logging to stdout...";
 	    close_log ();
 	    if !!log_file <> "" then
 	      begin
                 let oc = open_out_gen [Open_creat; Open_wronly; Open_append] 0o644 !!log_file in
                   log_to_file oc;
-                  lprintf_nl () "Reopened %s" !!log_file
+                  lprintf_nl "Reopened %s" !!log_file
 	      end
 	  end;
         Printf.sprintf (_b "log to stdout %s")
@@ -2943,7 +2947,7 @@
     ), ":\t\t\t\tenable logging to file";
 
     "close_log", Arg_none (fun o ->
-	lprintf_nl () "Stopped logging...";
+  lprintf_nl "Stopped logging...";
         close_log ();
         _s "log stopped"
     ), ":\t\t\t\tclose logging to file";
@@ -2954,7 +2958,7 @@
             close_log ();
             let oc = open_out_gen [Open_creat; Open_wronly; Open_trunc] 0o644 !!log_file in
               log_to_file oc;
-              lprintf_nl () "Cleared %s" !!log_file;
+              lprintf_nl "Cleared %s" !!log_file;
               Printf.sprintf "Logfile %s cleared" !!log_file
           end
         else
Index: src/daemon/driver/driverControlers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverControlers.ml,v
retrieving revision 1.68
diff -u -u -w -r1.68 driverControlers.ml
--- src/daemon/driver/driverControlers.ml	18 May 2006 17:28:44 -0000	1.68
+++ src/daemon/driver/driverControlers.ml	19 May 2006 21:58:19 -0000
@@ -37,15 +37,13 @@
 open CommonOptions
 open CommonUserDb
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[dCon] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[dCon] "
-    (log_time ()); lprintf
+let log_prefix = "[dCon]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let rec dollar_escape o with_frames s =
   String2.convert false (fun b escaped c ->
@@ -317,7 +315,7 @@
         if valid_password user pass then begin
             auth := true;
             o.conn_user <- find_ui_user user;
-            lprintf_nl () "Authenticated user: %s" user;
+            lprintf_nl "Authenticated user: %s" user;
             let module M = CommonMessages in
             Buffer.add_string buf M.full_access
           end else
@@ -350,9 +348,9 @@
   List.iter (fun (days, hours, command) ->
       if (List.mem tm.Unix.tm_wday days || days = []) &&
         (List.mem tm.Unix.tm_hour hours || hours = []) then begin
-          lprintf_nl () "Calendar execute: %s" command;
+          lprintf_nl "Calendar execute: %s" command;
           eval (ref true) command calendar_options;
-          lprintf_nl () "Calendar result: %s" (Buffer.contents calendar_options.conn_buf);
+          lprintf_nl "Calendar result: %s" (Buffer.contents calendar_options.conn_buf);
           Buffer.reset calendar_options.conn_buf;
         end
   ) !!calendar
@@ -573,7 +571,7 @@
   match event with
     TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) ->
       let from_ip = Ip.of_inet_addr from_ip in
-        lprintf_nl () "Telnet connection from %s" (Ip.to_string from_ip);
+        lprintf_nl "Telnet connection from %s" (Ip.to_string from_ip);
         let token = create_token unlimited_connection_manager in
         let sock = TcpBufferedSocket.create_simple token
           "telnet connection"
@@ -620,7 +618,7 @@
 	in
 	TcpBufferedSocket.write_string sock (dollar_escape o false reject_message);
 	shutdown sock Closed_connect_failed;
-	lprintf_n () "%s" reject_message;
+  lprintf_n "%s" reject_message;
 	Unix.close s
       end
 
@@ -696,7 +694,7 @@
            Unix.close s
      with
        Failure mess ->
-         lprintf_nl () "%s" mess;
+         lprintf_nl "%s" mess;
          Unix.close s
     )
   | _ ->
@@ -907,7 +905,7 @@
   let ext_pos = (String.rindex filename '.') + 1 in
   let exten = (String.sub filename ext_pos ((String.length filename) - ext_pos)) in
   if !verbose_msg_servers then
-    lprintf_nl () "Extension found [%s] for file: [%s]" exten filename;
+    lprintf_nl "Extension found [%s] for file: [%s]" exten filename;
   let ext = extension_to_file_ext exten in
   http_add_bin_header r ext clen;
   Buffer.add_string buf file_to_send
@@ -917,15 +915,15 @@
     "jpg" ->
       (match Autoconf.has_gd_jpg with
         true -> false
-      | false -> lprintf_nl () "Warning: GD jpg support disabled"; true)
+      | false -> lprintf_nl "Warning: GD jpg support disabled"; true)
   | "png" ->
       (match Autoconf.has_gd_png with
         true -> false
-      | false -> lprintf_nl () "Warning: GD png support disabled"; true)
+      | false -> lprintf_nl "Warning: GD png support disabled"; true)
   | _ ->
       (match Autoconf.has_gd with
         true -> false
-      | false -> lprintf_nl () "Warning: GD support disabled"; true)
+      | false -> lprintf_nl "Warning: GD support disabled"; true)
 let any_ip = Ip.of_inet_addr Unix.inet_addr_any
 
 let html_open_page buf t r open_body =
@@ -1266,7 +1264,7 @@
 
         | "favicon.ico" ->
             if !verbose_msg_servers then
-              lprintf_nl () "favicon.ico request received by tracker";
+              lprintf_nl "favicon.ico request received by tracker";
             http_send_bin r buf "favicon.ico"
 
         | "filter" ->
@@ -1465,7 +1463,7 @@
 
               | args ->
                   List.iter (fun (s,v) ->
-                      lprintf_nl () "[%s]=[%s]" (String.escaped s) (String.escaped v))
+                      lprintf_nl "[%s]=[%s]" (String.escaped s) (String.escaped v))
                   args;
                   raise Not_found
             end
@@ -1485,7 +1483,7 @@
 
               | args ->
                   List.iter (fun (s,v) ->
-                      lprintf_nl () "[%s]=[%s]" (String.escaped s) (String.escaped v))
+                      lprintf_nl "[%s]=[%s]" (String.escaped s) (String.escaped v))
                   args;
                   raise Not_found
             end
@@ -1503,7 +1501,7 @@
 		  let exten = Filename2.last_extension impl.impl_shared_codedname in
 		  if not (Sys.file_exists filename) then
 		    begin
-		      lprintf_nl () "file %s not found" filename;
+          lprintf_nl "file %s not found" filename;
 		      raise Not_found
 		    end;
 		  let fd = Unix32.create_ro filename in
@@ -1512,7 +1510,7 @@
 
               | args ->
                   List.iter (fun (s,v) ->
-                      lprintf_nl () "[%s]=[%s]" (String.escaped s) (String.escaped v))
+                      lprintf_nl "[%s]=[%s]" (String.escaped s) (String.escaped v))
                   args;
                   raise Not_found
             end
Index: src/daemon/driver/driverInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml,v
retrieving revision 1.75
diff -u -u -w -r1.75 driverInteractive.ml
--- src/daemon/driver/driverInteractive.ml	18 May 2006 17:28:44 -0000	1.75
+++ src/daemon/driver/driverInteractive.ml	19 May 2006 21:58:19 -0000
@@ -38,15 +38,13 @@
 open CommonTypes
 open Int64ops
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s"
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s"
-    (log_time ()); lprintf
+let log_prefix = "[dIve]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let verify_user_admin () =
   let empty_pwd = ref false in
@@ -54,7 +52,7 @@
     if user2_password admin_user = blank_password then
       empty_pwd := true
     with e ->
-      lprintf_nl () "SECURITY INFO: user 'admin' has to be present, creating...";
+      lprintf_nl "SECURITY INFO: user 'admin' has to be present, creating...";
       empty_pwd := true;
       ignore (user2_add admin_user blank_password "")
   end;
@@ -63,7 +61,7 @@
   in
   if !empty_pwd && not !!enable_user_config then
     begin
-      lprintf_n () "%s" warning;
+      lprintf_n "%s" warning;
       warning
     end
   else ""
@@ -72,7 +70,7 @@
   let uname = Unix32.uname () in
   let message = Printf.sprintf "MLDonkey is not able to run faultless under %s" uname; in
   if uname <> "" && not (Unix32.os_supported ()) then begin
-    lprintf_nl () "%s" message;
+    lprintf_nl "%s" message;
     message;
   end
   else ""
@@ -127,7 +125,7 @@
 
 let file_magic_check () =
   if !Autoconf.magic_works then begin
-    if !verbose then lprintf_nl () "computing file magic values";
+    if !verbose then lprintf_nl "computing file magic values";
     let check_magic file =
       match Magic.M.magic_fileinfo (file_disk_name file) false with
         None -> ()
Index: src/daemon/driver/driverInterface.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInterface.ml,v
retrieving revision 1.43
diff -u -u -w -r1.43 driverInterface.ml
--- src/daemon/driver/driverInterface.ml	17 May 2006 08:52:43 -0000	1.43
+++ src/daemon/driver/driverInterface.ml	19 May 2006 21:58:19 -0000
@@ -43,10 +43,14 @@
 open CommonUserDb
 
 module P = GuiProto
-let lprintf_nl () =
-  lprintf "%s[dIface] "
-    (log_time ()); lprintf_nl2
 
+let log_prefix = "[dIface]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let binary_gui_send gui t =
   match gui.gui_sock with
@@ -533,7 +537,7 @@
           (to_gui_last_opcode + 1) version;
         gui.gui_proto_from_gui_version <- Array.create 
           (from_gui_last_opcode + 1) version;
-        lprintf_nl () "GUI protocol %d" version    
+        lprintf_nl "GUI protocol %d" version    
     
     | P.GuiExtensions list ->
         List.iter (fun (ext, bool) ->
@@ -565,12 +569,12 @@
     
     | P.Password (user, pass) ->
         begin
-          lprintf_nl () "GUI connection from user %s" user;
+          lprintf_nl "GUI connection from user %s" user;
           match gui.gui_sock with
             Some sock when not (valid_password user pass) ->
               gui_send gui BadPassword;                  
               set_lifetime sock 5.;
-              lprintf_nl () "GUI connection BAD PASSWORD for user %s" user; 
+              lprintf_nl "GUI connection BAD PASSWORD for user %s" user; 
               TcpBufferedSocket.close sock (Closed_for_error "Bad Password")
           
           | _ ->
@@ -1168,7 +1172,7 @@
   match event with
     TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) ->
       let from_ip = Ip.of_inet_addr from_ip in
-      lprintf_nl () "GUI connection from %s" (Ip.to_string from_ip);
+      lprintf_nl "GUI connection from %s" (Ip.to_string from_ip);
       if Ip.matches from_ip !!allowed_ips then 
         
         let module P = GuiProto in
@@ -1197,7 +1201,7 @@
         (* sort GUIs in increasing order of their num *)
         
       else begin
-          lprintf_nl () "GUI connection from %s rejected (see allowed_ips setting)"
+          lprintf_nl "GUI connection from %s rejected (see allowed_ips setting)"
             (Ip.to_string from_ip);
           Unix.close s
         end
Index: src/daemon/driver/driverMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverMain.ml,v
retrieving revision 1.107
diff -u -u -w -r1.107 driverMain.ml
--- src/daemon/driver/driverMain.ml	12 May 2006 21:08:30 -0000	1.107
+++ src/daemon/driver/driverMain.ml	19 May 2006 21:58:19 -0000
@@ -51,15 +51,14 @@
 let _s x = _s "DriverMain" x
 let _b x = _b "DriverMain" x
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s"
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s"
-    (log_time ()); lprintf
+let log_prefix = "[dMain]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
+
 
 let keep_console_output = ref false
 let pid = ref ""
@@ -99,11 +98,11 @@
   (try
       update_link_stats ()
     with e ->
-        lprintf_nl () (_b "Exception %s") (Printexc2.to_string e));
+        lprintf_nl (_b "Exception %s") (Printexc2.to_string e));
 	  (try
      CommonUploads.refill_upload_slots ()
    with e ->
-        lprintf_nl () (_b "Exception %s") (Printexc2.to_string e));
+        lprintf_nl (_b "Exception %s") (Printexc2.to_string e));
   CommonUploads.reset_upload_timer ();
   CommonUploads.shared_files_timer ();
   ()
@@ -114,7 +113,7 @@
   if !!http_port <> 0 then begin try
         ignore (DriverControlers.create_http_handler ());
       with e ->
-          lprintf_nl () (_b "Exception %s while starting HTTP interface")
+          lprintf_nl (_b "Exception %s while starting HTTP interface")
             (Printexc2.to_string e);
     end;
 
@@ -144,7 +143,7 @@
 let _ =
   CommonWeb.add_web_kind "motd.html" "Information of the day in HTML format" 
     (fun _ filename ->
-      lprintf_nl () (_b "motd.html changed");
+      lprintf_nl (_b "motd.html changed");
     motd_html =:= File.to_string filename
   );
   CommonWeb.add_web_kind "motd.conf" "Setup changes of the day" 
@@ -164,12 +163,12 @@
 	      | "del_item" ->
 		  CommonInteractive.del_item_from_fully_qualified_options name value
 	      | _ ->
-		  lprintf_nl () (_b "UNUSED LINE: %s") line
+      lprintf_nl (_b "UNUSED LINE: %s") line
 	  done
 	with End_of_file -> ())
     with
 	e -> 
-	  lprintf_nl () (_b "Error while reading motd.conf(%s): %s") filename
+    lprintf_nl (_b "Error while reading motd.conf(%s): %s") filename
 	    (Printexc2.to_string e)
   )
 
@@ -261,7 +260,7 @@
   in
   if not exists_users_ini && exists_downloads_ini then
     begin
-      lprintf_nl () "No config file (users.ini) found. Importing users from downloads.ini.";
+      lprintf_nl "No config file (users.ini) found. Importing users from downloads.ini.";
       ( try Unix2.copy "downloads.ini" "users.ini" with _ -> () );
     end;
 
@@ -273,7 +272,7 @@
       ignore (DriverInteractive.verify_user_admin ());
       DriverInteractive.hdd_check ()
     with e ->
-        lprintf_nl () "Exception %s during options load" (Printexc2.to_string e);
+        lprintf_nl "Exception %s during options load" (Printexc2.to_string e);
         exit 70);
 
   (* Here, we try to update options when a new version of mldonkey is
@@ -321,14 +320,14 @@
 
   Arg.parse ([
       "-v", Arg.Unit (fun _ ->
-          lprintf_nl () "%s" (CommonGlobals.version ());
+          lprintf_nl "%s" (CommonGlobals.version ());
           exit 0), _s " : print version number and exit";
       "-exit", Arg.Unit (fun _ -> exit 0), ": exit immediatly";
       "-format", Arg.String (fun file ->
           ignore (CommonMultimedia.get_info file)),
           _s  " <filename> : check file format";
       "-test_ip", Arg.String (fun ip ->
-          lprintf_nl () "%s = %s" ip (Ip.to_string (Ip.of_string ip));
+          lprintf_nl "%s = %s" ip (Ip.to_string (Ip.of_string ip));
           exit 0), _s "<ip> : undocumented";
       "-check_impl", Arg.Unit (fun _ ->
           CommonNetwork.check_network_implementations ();
@@ -351,7 +350,7 @@
        _s ": keep output to stderr after startup";
       "-daemon", Arg.Unit (fun _ ->
           (* Removed due to savannah bug #11514 . *)
-          lprintf_nl () "\n\nOption -daemon was removed.\nUse 'mlnet > /dev/null 2>&1 &' instead. Exiting...";
+          lprintf_nl "\n\nOption -daemon was removed.\nUse 'mlnet > /dev/null 2>&1 &' instead. Exiting...";
           exit 64), _s " : this argument was removed, core will exit";
       "-find_port", Arg.Set find_other_port,
       _s " : find another port when one is already used";
@@ -388,8 +387,8 @@
   let t = Unix.localtime (Unix.time ()) in
   if (t.Unix.tm_year<=104) then
     begin
-      lprintf_nl () (_b "\n\n\nYour system has a system date earlier than 2004, please correct it.");
-      lprintf_nl () (_b "MLdonkey can not work with such a system date, exiting...");
+      lprintf_nl (_b "\n\n\nYour system has a system date earlier than 2004, please correct it.");
+      lprintf_nl (_b "MLdonkey can not work with such a system date, exiting...");
       CommonGlobals.exit_properly 71
     end;
 
@@ -423,12 +422,12 @@
       if Magic.M.magic_works () then
         begin
 	  Autoconf.magic_works := true;
-          lprintf_nl () (_b "Libmagic file-type recognition database present")
+          lprintf_nl (_b "Libmagic file-type recognition database present")
 	end
       else
         begin
 	  Autoconf.magic_works := false;
-          lprintf_nl () (_b "Libmagic file-type recognition database not present")
+          lprintf_nl (_b "Libmagic file-type recognition database not present")
 	end
   );
   load_config ();
@@ -450,7 +449,7 @@
   end;
 
 (*  lprintf "(3) networks_iter load_complex_options\n"; *)
-  lprintf_nl () (_b "Check http://www.mldonkey.net/ for updates");
+  lprintf_nl (_b "Check http://www.mldonkey.net/ for updates");
   networks_iter (fun r -> network_load_complex_options r);
   lprintf (_b "%senabling networks: ") (log_time ());
   networks_iter (fun r ->
@@ -502,17 +501,17 @@
   Options.prune_file users_ini;
 (*  Options.prune_file downloads_expert_ini; *)
   add_timer 5. (fun _ -> try CommonWeb.load_web_infos true with _ -> ());
-  lprintf_nl ()  (_b "To command: telnet %s %d")
+  lprintf_nl  (_b "To command: telnet %s %d")
 	(if !!telnet_bind_addr = Ip.any then "127.0.0.1"
 		else Ip.to_string !!telnet_bind_addr)  !!telnet_port;
-  lprintf_nl ()  (_b "Or with browser: http://%s:%d")
+  lprintf_nl  (_b "Or with browser: http://%s:%d")
 	(if !!http_bind_addr = Ip.any then "127.0.0.1"
 		else Ip.to_string !!http_bind_addr)  !!http_port;
-  lprintf_nl ()  (_b "For a GUI check out http://sancho-gui.sourceforge.net");
-  lprintf_nl ()  (_b "Connect to IP %s, port %d")
+  lprintf_nl  (_b "For a GUI check out http://sancho-gui.sourceforge.net");
+  lprintf_nl  (_b "Connect to IP %s, port %d")
 	(if !!gui_bind_addr = Ip.any then "127.0.0.1"
 		else Ip.to_string !!gui_bind_addr)  !!gui_port;
-  lprintf_nl ()  (_b "If you connect from a remote machine adjust allowed_ips");
+  lprintf_nl  (_b "If you connect from a remote machine adjust allowed_ips");
   if Autoconf.system = "cygwin" && not !keep_console_output then lprintf (_b "%s") win_message;
 
   add_init_hook (fun _ ->
@@ -527,7 +526,7 @@
             Sys.file_exists asker then
             ignore (Sys.command (Printf.sprintf "%s %s&" asker !!mldonkey_gui));
         with Not_found ->
-            lprintf_nl () (_b "Not running under X, not trying to start the GUI")
+            lprintf_nl (_b "Not running under X, not trying to start the GUI")
             );
   );
 
@@ -536,9 +535,9 @@
         let new_pw = Unix.getpwnam !!run_as_user in
         MlUnix.setuid new_pw.Unix.pw_uid;
         let pw = Unix.getpwuid (Unix.getuid()) in
-        lprintf_nl () (_b "mldonkey is now running as user %s") pw.Unix.pw_name;
+        lprintf_nl (_b "mldonkey is now running as user %s") pw.Unix.pw_name;
       with e ->
-          lprintf_nl () (_b "Exception %s trying to set user_uid [%s]")
+          lprintf_nl (_b "Exception %s trying to set user_uid [%s]")
           (Printexc2.to_string e) !!run_as_user;
           exit 67
     end;
@@ -546,9 +545,9 @@
   if !!run_as_useruid <> 0 then begin
       try
         MlUnix.setuid !!run_as_useruid;
-        lprintf_nl () (_b "mldonkey is now running as uid %d")  !!run_as_useruid;
+        lprintf_nl (_b "mldonkey is now running as uid %d")  !!run_as_useruid;
       with e ->
-          lprintf_nl () (_b "Exception %s trying to set user_uid [%d]")
+          lprintf_nl (_b "Exception %s trying to set user_uid [%d]")
           (Printexc2.to_string e) !!run_as_useruid;
           exit 67
     end;
@@ -559,42 +558,42 @@
 
   if not Autoconf.windows then
     MlUnix.set_signal  Sys.sigchld
-      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl () "Received SIGCHLD, doing nothing"));
+      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl "Received SIGCHLD, doing nothing"));
 
   if not Autoconf.windows then
     MlUnix.set_signal  Sys.sighup
       (Sys.Signal_handle (fun _ ->
-	 lprintf_nl () "Received SIGHUP, closing all files/sockets";
+   lprintf_nl "Received SIGHUP, closing all files/sockets";
          BasicSocket.close_all ();
 	 Unix32.close_all ()
          ));
 
   if not Autoconf.windows then
     MlUnix.set_signal  Sys.sigpipe
-      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl () "Received SIGPIPE, doing nothing"));
+      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl "Received SIGPIPE, doing nothing"));
 
   MlUnix.set_signal  Sys.sigint
-    (Sys.Signal_handle (fun _ -> lprintf_nl () "Received SIGINT, stopping MLDonkey...";
+    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGINT, stopping MLDonkey...";
         CommonInteractive.clean_exit 0));
 
   MlUnix.set_signal  Sys.sigterm
-    (Sys.Signal_handle (fun _ -> lprintf_nl () "Received SIGTERM, stopping MLDonkey...";
+    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGTERM, stopping MLDonkey...";
         CommonInteractive.clean_exit 0));
 
   if not Autoconf.windows then
   MlUnix.set_signal  Sys.sigusr1
-    (Sys.Signal_handle (fun _ -> lprintf_nl () "Received SIGUSR1, saving options...";
+    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGUSR1, saving options...";
         DriverInteractive.save_config ()));
 
   if not Autoconf.windows then
   MlUnix.set_signal  Sys.sigusr2
     (Sys.Signal_handle (fun _ ->
-	lprintf_n () "Received SIGUSR2, starting garbage collection...";
+  lprintf_n "Received SIGUSR2, starting garbage collection...";
 	Gc.compact ();
 	lprintf " finished";
 	lprint_newline ()));
 
-  if !verbose then lprintf_nl () (_b "Activated system signal handling")
+  if !verbose then lprintf_nl (_b "Activated system signal handling")
 
 let _ =
   let security_space_filename = "config_files_space.tmp" in
@@ -617,9 +616,9 @@
       in
       Unix32.close security_space_fd;
     with _ ->
-        lprintf_nl () (_b "Cannot create Security space file:");
-        lprintf_nl () (_b " not enough space on device or bad permissions");
-        lprintf_nl () (_b "Exiting...");
+        lprintf_nl (_b "Cannot create Security space file:");
+        lprintf_nl (_b " not enough space on device or bad permissions");
+        lprintf_nl (_b "Exiting...");
         exit 73;
   end;
   Unix32.external_start ();
@@ -635,7 +634,7 @@
     Unix2.tryopen_write pid_file (fun oc -> output_string oc s);
     CommonGlobals.do_at_exit (fun _ -> try Sys.remove pid_file with _ -> ());
     if !verbose then
-      lprintf_nl () (_b "Starting with pid %s") (string_of_int(Unix.getpid ()))
+      lprintf_nl (_b "Starting with pid %s") (string_of_int(Unix.getpid ()))
   );
 
 (* When a core is spawned from a gui, the only way to know the startup has
@@ -648,7 +647,7 @@
       with _ -> ()
     end;
 
-  lprintf_nl () (_b "Core started");
+  lprintf_nl (_b "Core started");
   core_included := true;
 
   CommonGlobals.do_at_exit (fun _ ->
@@ -657,7 +656,7 @@
       (try
          BasicSocket.close_all ();
        with e ->
-           lprintf_nl () "Exception %s in do_at_exit while closing sockets."
+           lprintf_nl "Exception %s in do_at_exit while closing sockets."
              (Printexc2.to_string e);
       );
       DriverGraphics.G.remove_files ();
@@ -670,14 +669,14 @@
       CommonComplexOptions.backup_options ();
       Geoip.close ();
       Unix32.external_exit ();
-      lprintf_nl () (_b "Core stopped")
+      lprintf_nl (_b "Core stopped")
     );
 
   if not !keep_console_output then
     if !!log_file = "" then 
       begin
-        lprintf_nl () (_b "Option log_file is empty, disable logging completely...");
-        lprintf_nl () (_b "Disabling output to console, to enable: stdout true");
+        lprintf_nl (_b "Option log_file is empty, disable logging completely...");
+        lprintf_nl (_b "Disabling output to console, to enable: stdout true");
 	log_to_file stdout;
         close_log ()
       end
Index: src/networks/bittorrent/bTChooser.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTChooser.ml,v
retrieving revision 1.11
diff -u -u -w -r1.11 bTChooser.ml
--- src/networks/bittorrent/bTChooser.ml	9 Apr 2006 00:27:03 -0000	1.11
+++ src/networks/bittorrent/bTChooser.ml	19 May 2006 21:58:26 -0000
@@ -32,16 +32,6 @@
 open BTOptions
 open BTGlobals
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[BT] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[BT] "
-    (log_time ()); lprintf
-
 (*given some files choose the next uploaders based on their behavior
   Will choose max_uploaders_per_torrent uploaders for each file in list
   fun_comp is the function use to classify clients
@@ -67,7 +57,7 @@
             possible_uploaders := (c::!possible_uploaders);
           end )  f.file_clients;
       if !verbose_upload then
-          lprintf_nl () "clients num %d as possible uploaders for file %s" (List.length !possible_uploaders) f.file_name;
+          lprintf_nl "clients num %d as possible uploaders for file %s" (List.length !possible_uploaders) f.file_name;
       (*Interested clients with a connection*)
       let filtl = List.filter (fun c -> c.client_interested == true
             && (c.client_sock != NoConnection)
@@ -91,12 +81,12 @@
       full_list := !full_list @ to_add;
       if !verbose_upload then
         begin
-          lprintf_n () "potential uploaders count: %d list: [" (List.length to_add);
+          lprintf_n "potential uploaders count: %d list: [" (List.length to_add);
           List.iter (fun cr ->
               let (ip,port) = cr.client_host in
                   lprintf " %s:%d" (Ip.to_string ip) port;
              ) to_add;
-          lprintf_nl2 " ]";
+          lprintf " ]\n";
         end;
 
   ) files;
@@ -146,24 +136,24 @@
   begin
     if !verbose_upload then
         begin
-          lprintf_n () "next_uploaders: %d list: [" (List.length next_uploaders);
+          lprintf_n "next_uploaders: %d list: [" (List.length next_uploaders);
           List.iter (fun cr ->
               let (ip,port) = cr.client_host in
                   lprintf " %s:%d" (Ip.to_string ip) port;
              ) next_uploaders;
-          lprintf_nl2 " ]";
+          lprintf " ]\n";
         end;
     if (List.length next_uploaders) > !!max_bt_uploaders then
         let keep,rest = List2.cut !!max_bt_uploaders next_uploaders in
         begin
           if !verbose_upload then
              begin
-               lprintf_n () "cut next_uploaders: %d list: [" (List.length keep);
+               lprintf_n "cut next_uploaders: %d list: [" (List.length keep);
                List.iter (fun cr ->
                     let (ip,port) = cr.client_host in
                         lprintf " %s:%d" (Ip.to_string ip) port;
                    ) keep;
-               lprintf_nl2 " ]";
+               lprintf " ]\n";
              end;
           keep
         end
Index: src/networks/bittorrent/bTClients.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTClients.ml,v
retrieving revision 1.69
diff -u -u -w -r1.69 bTClients.ml
--- src/networks/bittorrent/bTClients.ml	14 May 2006 19:09:21 -0000	1.69
+++ src/networks/bittorrent/bTClients.ml	19 May 2006 21:58:26 -0000
@@ -64,16 +64,6 @@
 open BTStats
 open TcpMessages
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[BT] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[BT] "
-    (log_time ()); lprintf
-
 let http_ok = "HTTP 200 OK"
 let http11_ok = "HTTP/1.1 200 OK"
 
@@ -144,7 +134,7 @@
     else begin
       (* if there is no tracker left, do something ? *)
       if !verbose_msg_servers then
-	lprintf_nl () "No trackers left, reenabling all of them...";
+  lprintf_nl "No trackers left, reenabling all of them...";
       List.iter (fun t -> t.tracker_enabled <- can_handle_tracker t) file.file_trackers;
       file.file_trackers
     end in
@@ -167,7 +157,7 @@
           if file.file_tracker_connected && t.tracker_last_clients_num = 0 &&
             t.tracker_last_conn < 1 then begin
               if !verbose_msg_servers then
-                lprintf_nl () "Request error from tracker: disabling %s" t.tracker_url;
+                lprintf_nl "Request error from tracker: disabling %s" t.tracker_url;
 	      t.tracker_enabled <- false;
               (* remove_tracker t.tracker_url file *)
             end
@@ -180,7 +170,7 @@
                   ("key", t.tracker_key) :: args else args
               in
               if !verbose_msg_servers then
-                lprintf_nl () "get_sources_from_tracker: tracker_connected:%s id:%s key:%s last_clients:%i last_conn-last_time:%i file: %s"
+                lprintf_nl "get_sources_from_tracker: tracker_connected:%s id:%s key:%s last_clients:%i last_conn-last_time:%i file: %s"
                   (string_of_bool file.file_tracker_connected)
                   t.tracker_id t.tracker_key t.tracker_last_clients_num
                   (t.tracker_last_conn - last_time()) file.file_name;
@@ -197,7 +187,7 @@
                 } in
 
               if !verbose_msg_servers then
-                  lprintf_nl () "Request sent to tracker %s for file: %s"
+                  lprintf_nl "Request sent to tracker %s for file: %s"
                     t.tracker_url file.file_name;
               H.wget r
                 (fun fileres ->
@@ -209,7 +199,7 @@
 
       else
         if !verbose_msg_servers then
-          lprintf_nl () "Request NOT sent to tracker %s - next request in %ds for file: %s"
+          lprintf_nl "Request NOT sent to tracker %s - next request in %ds for file: %s"
             t.tracker_url (t.tracker_interval - (last_time () - t.tracker_last_conn)) file.file_name
   ) enabled_trackers
 
@@ -219,7 +209,7 @@
   for clients that are in next list (and not in current)
 *)
 let recompute_uploaders () =
-  if !verbose_upload then lprintf_nl () "recompute_uploaders";
+  if !verbose_upload then lprintf_nl "recompute_uploaders";
   next_uploaders := choose_uploaders current_files;
   (*Send choke if a current_uploader is not in next_uploaders*)
   List.iter ( fun c -> if ((List.mem c !next_uploaders)==false) then
@@ -257,7 +247,7 @@
 *)
 let disconnect_client c reason =
   if !verbose_msg_clients then
-    lprintf_nl () "Client %d: disconnected: %s" (client_num c) (string_of_reason reason);
+    lprintf_nl "Client %d: disconnected: %s" (client_num c) (string_of_reason reason);
   begin
     match c.client_sock with
       NoConnection -> ()
@@ -330,7 +320,7 @@
   if not ( !must_keep && (client_has_a_slot (as_client c) || c.client_interested)) then
     begin
       if !verbose_msg_clients then
-        lprintf_nl () "disconnect since download is finished";
+        lprintf_nl "disconnect since download is finished";
       disconnect_client c Closed_by_user
     end
   ) file.file_clients
@@ -403,7 +393,7 @@
         CommonSwarming.verified_bitmap swarmer
   in
 
-  if !verbose_download then lprintf_nl () "Sending verified bitmap: [%s]" bitmap;
+  if !verbose_download then lprintf_nl "Sending verified bitmap: [%s]" bitmap;
 
 (* In the future, only accept bitmap.[n] > '2' when verification works *)
   send_client c (BitField
@@ -437,16 +427,16 @@
   try
     set_lifetime sock 600.;
     if !verbose_msg_clients then
-      lprintf_nl () "client_parse_header %d" counter;
+      lprintf_nl "client_parse_header %d" counter;
 
     let file = Hashtbl.find files_by_uid file_id in
     if !verbose_msg_clients then
-      lprintf_nl () "file found";
+      lprintf_nl "file found";
     let c =
       match !cc with
         None ->
           let c = new_client file Sha1.null (TcpBufferedSocket.peer_addr sock) in
-          if !verbose_connect then lprintf_nl () "Client %d: incoming connection" (client_num c);
+          if !verbose_connect then lprintf_nl "Client %d: incoming connection" (client_num c);
           cc := Some c;
           c
       | Some c ->
@@ -483,7 +473,7 @@
 
     if !verbose_msg_clients then begin
         let (ip,port) = c.client_host in
-          lprintf_nl () "Client %d: Connected from %s:%d" (client_num c)
+          lprintf_nl "Client %d: Connected from %s:%d" (client_num c)
             (Ip.to_string ip) port;
       end;
 
@@ -491,17 +481,17 @@
         NoConnection ->
           if !verbose_msg_clients then begin
               let (ip,port) = c.client_host in
-              lprintf_nl () "No connection to client (%s:%d)!!!" (Ip.to_string ip) port;
+              lprintf_nl "No connection to client (%s:%d)!!!" (Ip.to_string ip) port;
             end;
           c.client_sock <- Connection sock
       | ConnectionWaiting token ->
           cancel_token token;
           if !verbose_msg_clients then
-            lprintf_nl () "Waiting for connection to client !!!";
+            lprintf_nl "Waiting for connection to client !!!";
           c.client_sock <- Connection sock
       | Connection s when s != sock ->
           if !verbose_msg_clients then
-            lprintf_nl () "CLIENT %d: IMMEDIATE RECONNECTION" (client_num c);
+            lprintf_nl "CLIENT %d: IMMEDIATE RECONNECTION" (client_num c);
           disconnect_client c (Closed_for_error "Reconnected");
           c.client_sock <- Connection sock;
       | Connection _  -> ()
@@ -515,7 +505,7 @@
       end;
     connection_ok c.client_connection_control;
     if !verbose_msg_clients then
-      lprintf_nl () "file and client found";
+      lprintf_nl "file and client found";
 (*    if not c.client_incoming then *)
      send_bitfield c; 
     c.client_blocks_sent <- file.file_blocks_downloaded;
@@ -537,10 +527,10 @@
       | Not_found ->
           let (ip,port) = (TcpBufferedSocket.peer_addr sock) in
           if !verbose_unexpected_messages then
-            lprintf_nl () "Client %s:%d requested a file that is not shared [%s]"
+            lprintf_nl "Client %s:%d requested a file that is not shared [%s]"
               (Ip.to_string ip) port (Sha1.to_hexa file_id)
       | e ->
-          lprintf_nl () "Exception %s in client_parse_header" (Printexc2.to_string e);
+          lprintf_nl "Exception %s in client_parse_header" (Printexc2.to_string e);
       close sock (Closed_for_exception e);
       raise e
 
@@ -609,11 +599,11 @@
     let num, x,y, r =
 
       if !verbose_msg_clients then begin
-        lprintf_nl () "CLIENT %d: Finding new range to send" (client_num c);
+        lprintf_nl "CLIENT %d: Finding new range to send" (client_num c);
       end;
 
       if !verbose_swarming then begin
-        lprintf_n () "Current download:\n  Current chunks: ";
+        lprintf_n "Current download:\n  Current chunks: ";
 
         try
           List.iter (fun (x,y) -> lprintf "%Ld-%Ld " x y) c.client_chunks
@@ -621,7 +611,7 @@
           
         lprint_newline ();
           
-        lprintf_n () "Current ranges: ";
+        lprintf_n "Current ranges: ";
           
         List.iter (fun (p1,p2, r) ->
           let (x,y) = CommonSwarming.range_range r in
@@ -634,7 +624,7 @@
 
         lprint_newline ();
           
-        lprintf_n () "Current block: ";
+        lprintf_n "Current block: ";
           
         match c.client_block with
         | None -> lprintf "none"
@@ -642,7 +632,7 @@
 
         lprint_newline ();
       
-        lprintf_nl () "Finding Range:";
+        lprintf_nl "Finding Range:";
       end;
 
       try
@@ -657,13 +647,13 @@
 
             None -> 
 
-              if !verbose_swarming then lprintf_nl () "No block";
+              if !verbose_swarming then lprintf_nl "No block";
               update_client_bitmap c;
               (try CommonSwarming.verify_one_chunk swarmer with _ -> ());
               (*Find a free block in the swarmer*)
               let b = CommonSwarming.find_block up in
               if !verbose_swarming then begin 
-                lprintf_n () "Block Found: "; CommonSwarming.print_block b;
+                lprintf_n "Block Found: "; CommonSwarming.print_block b;
                 lprint_newline ()
               end;
               c.client_block <- Some b;
@@ -678,7 +668,7 @@
           | Some b ->
 
               if !verbose_swarming then begin
-                lprintf_n () "Current Block: "; CommonSwarming.print_block b;
+                lprintf_n "Current Block: "; CommonSwarming.print_block b;
                 lprint_newline ()
               end;
 
@@ -708,7 +698,7 @@
                   let num = CommonSwarming.block_num swarmer b in
 
                   if !verbose_swarming then 
-                    lprintf_nl () "Asking %d For Range %Ld-%Ld" num x y;
+                    lprintf_nl "Asking %d For Range %Ld-%Ld" num x y;
                       
                   num, x -- file.file_piece_size ** Int64.of_int num, y -- x, r
 
@@ -717,7 +707,7 @@
                   (*If we don't find a range to request inside the block,
                     iter to choose another block*)
                   if !verbose_swarming then
-                    lprintf_nl () "Could not find range in current block";
+                    lprintf_nl "Could not find range in current block";
 (*                  c.client_blocks <- List2.removeq b c.client_blocks; *)
 
                   c.client_block <- None;
@@ -734,7 +724,7 @@
             a block to ask)
           *)
           if !verbose_swarming then
-            lprintf_nl () "Unable to get a block !!";
+            lprintf_nl "Unable to get a block !!";
           CommonSwarming.compute_bitmap swarmer;
           check_finished swarmer file;
           raise Not_found
@@ -743,12 +733,12 @@
     send_client c (Request (num,x,y));
 
     if !verbose_msg_clients then
-      lprintf_nl () "CLIENT %d: Asking %s For Range %Ld-%Ld"
+      lprintf_nl "CLIENT %d: Asking %s For Range %Ld-%Ld"
         (client_num c) (Sha1.to_string c.client_uid) x y
 
   with Not_found ->
         if not (CommonSwarming.check_finished swarmer) && !verbose_download then
-          lprintf_nl () "BTClient.get_from_client ERROR: can't find a block to download and file is not yet finished for file : %s..." file.file_name
+          lprintf_nl "BTClient.get_from_client ERROR: can't find a block to download and file is not yet finished for file : %s..." file.file_name
 
 
 (** In this function we match a message sent by a client
@@ -760,7 +750,7 @@
 and client_to_client c sock msg =
   if !verbose_msg_clients then begin
       let (timeout, next) = get_rtimeout sock in
-      lprintf_nl () "CLIENT %d: (%d, %d,%d) Received %s"
+      lprintf_nl "CLIENT %d: (%d, %d,%d) Received %s"
         (client_num c)
       (last_time ())
       (int_of_float timeout)
@@ -800,10 +790,10 @@
 
             if !verbose_msg_clients then
               (match c.client_ranges_sent with
-                  [] -> lprintf_nl () "EMPTY Ranges !!!"
+                  [] -> lprintf_nl "EMPTY Ranges !!!"
                 | (p1,p2,r) :: _ ->
                     let (x,y) = CommonSwarming.range_range r in
-                    lprintf_nl () "Current range from %s : %Ld [%d] (asked %Ld-%Ld[%Ld-%Ld])"
+                    lprintf_nl "Current range from %s : %Ld [%d] (asked %Ld-%Ld[%Ld-%Ld])"
                       (brand_to_string c.client_brand) position len
                       p1 p2 x y
               );
@@ -823,10 +813,10 @@
             Rate.update c.client_downloaded_rate  (float_of_int len);
             if !verbose_msg_clients then
               (match c.client_ranges_sent with
-                  [] -> lprintf_nl () "EMPTY Ranges !!!"
+                  [] -> lprintf_nl "EMPTY Ranges !!!"
                 | (p1,p2,r) :: _ ->
                     let (x,y) = CommonSwarming.range_range r in
-                    lprintf_nl () "Received %Ld [%d] %Ld-%Ld[%Ld-%Ld] -> %Ld"
+                    lprintf_nl "Received %Ld [%d] %Ld-%Ld[%Ld-%Ld] -> %Ld"
                       position len
                       p1 p2 x y
                       (new_downloaded -- old_downloaded)
@@ -912,7 +902,7 @@
               let nbits = String.length p * 8 in
 
               if nbits < npieces then begin
-                lprintf_nl () "Error: expected bitfield of atleast %d but got %d" npieces nbits;
+                lprintf_nl "Error: expected bitfield of atleast %d but got %d" npieces nbits;
                 disconnect_client c (Closed_for_error "Wrong bitfield length")
               end else begin
 
@@ -933,7 +923,7 @@
                   send_interested c;
 
                 if !verbose_msg_clients then
-                  lprintf_nl () "New BitField Registered";
+                  lprintf_nl "New BitField Registered";
 
                 (*  for i = 1 to max_range_requests - List.length c.client_ranges do
                       (try get_from_client sock c with _ -> ())
@@ -981,9 +971,9 @@
                   done*)
                       end
                   end
-          | None, Some _ -> lprintf_nl () "no bitmap but client_uploader";
-    | Some _ , None ->lprintf_nl () "bitmap but no client_uploader";
-    | None, None -> lprintf_nl () "no bitmap no client_uploader";
+          | None, Some _ -> lprintf_nl "no bitmap but client_uploader";
+    | Some _ , None ->lprintf_nl "bitmap but no client_uploader";
+    | None, None -> lprintf_nl "no bitmap no client_uploader";
         end
 *)
         end
@@ -1001,7 +991,7 @@
                 (* Afaik this is no protocol violation and happens if the client
                    didn't send a client bitmap after the handshake. *)
                 let (ip,port) = c.client_host in
-                  if !verbose_msg_clients then lprintf_nl () "%s:%d with software %s : Choke send, but no client bitmap"
+                  if !verbose_msg_clients then lprintf_nl "%s:%d with software %s : Choke send, but no client bitmap"
                     (Ip.to_string ip) port (brand_to_string c.client_brand)
             | Some up ->
                 CommonSwarming.clear_uploader_ranges up
@@ -1066,10 +1056,10 @@
           c.client_upload_requests <- List2.remove_first (n, pos, len) c.client_upload_requests
         else
           if !verbose_msg_clients then
-            lprintf_nl () "Error: received cancel request but client has no slot"
+            lprintf_nl "Error: received cancel request but client has no slot"
 
   with e ->
-      lprintf_nl () "Error %s while handling MESSAGE: %s" (Printexc2.to_string e) (TcpMessages.to_string msg)
+      lprintf_nl "Error %s while handling MESSAGE: %s" (Printexc2.to_string e) (TcpMessages.to_string msg)
 
 
 (** The function used to connect to a client.
@@ -1085,7 +1075,7 @@
        None -> true
      | Some reason ->
          if !verbose_connect then
-           lprintf_nl () "%s:%d blocked: %s"
+           lprintf_nl "%s:%d blocked: %s"
              (Ip.to_string ip) port reason;
          false)
   then
@@ -1096,10 +1086,10 @@
         add_pending_connection connection_manager (fun token ->
             try
               if !verbose_msg_clients then
-                lprintf_nl () "CLIENT %d: connect_client" (client_num c);
+                lprintf_nl "CLIENT %d: connect_client" (client_num c);
               let (ip,port) = c.client_host in
               if !verbose_msg_clients then
-                lprintf_nl () "connecting %s:%d" (Ip.to_string ip) port;
+                lprintf_nl "connecting %s:%d" (Ip.to_string ip) port;
               connection_try c.client_connection_control;
                 begin
                   let sock = connect token "bittorrent download"
@@ -1108,11 +1098,11 @@
                         match event with
                           BASIC_EVENT LTIMEOUT ->
                             if !verbose_msg_clients then
-                              lprintf_nl () "CLIENT %d: LIFETIME" (client_num c);
+                              lprintf_nl "CLIENT %d: LIFETIME" (client_num c);
                             close sock Closed_for_timeout
                         | BASIC_EVENT RTIMEOUT ->
                             if !verbose_msg_clients then
-                              lprintf_nl () "CLIENT %d: RTIMEOUT (%d)" (client_num c)
+                              lprintf_nl "CLIENT %d: RTIMEOUT (%d)" (client_num c)
                               (last_time ())
                               ;
                             close sock Closed_for_timeout
@@ -1134,7 +1124,7 @@
                   let file = c.client_file in
 
                   if !verbose_msg_clients then
-                    lprintf_nl () "READY TO DOWNLOAD FILE";
+                    lprintf_nl "READY TO DOWNLOAD FILE";
 
                   send_init !!client_uid file.file_id sock;
 (* Fabrice: Initialize the client bitmap and uploader fields to <> None *)
@@ -1149,7 +1139,7 @@
                     (BTHeader (client_parse_header !counter (ref (Some c)) true))
                 end
             with e ->
-                lprintf_nl () "Exception %s while connecting to client"
+                lprintf_nl "Exception %s while connecting to client"
                   (Printexc2.to_string e);
                 disconnect_client c (Closed_for_exception e)
         );
@@ -1178,7 +1168,7 @@
                 to connect to us
               *)
               let ip = (Ip.of_inet_addr from_ip) in
-              if !verbose_sources > 1 then lprintf_nl () "CONNECTION RECEIVED FROM %s"
+              if !verbose_sources > 1 then lprintf_nl "CONNECTION RECEIVED FROM %s"
                 (Ip.to_string (Ip.of_inet_addr from_ip))
               ;
               (*Reject this connection if we don't want
@@ -1189,7 +1179,7 @@
                    None -> true
                  | Some reason ->
                      if !verbose_connect then
-                       lprintf_nl () "%s:%d blocked: %s"
+                       lprintf_nl "%s:%d blocked: %s"
                          (Ip.to_string ip) from_port reason;
                      false)
               then
@@ -1238,7 +1228,7 @@
     ()
   with e ->
       if !verbose_connect then
-        lprintf_nl () "Exception %s while init bittorrent server"
+        lprintf_nl "Exception %s while init bittorrent server"
           (Printexc2.to_string e)
 
 
@@ -1282,7 +1272,7 @@
              with _ -> ())
       with e ->
           if !verbose_connect then
-            lprintf_nl () "Exception %s in resume_clients"   (Printexc2.to_string e)
+            lprintf_nl "Exception %s in resume_clients"   (Printexc2.to_string e)
   ) file.file_clients
 
 (** Check if the value replied by the tracker is correct.
@@ -1294,11 +1284,11 @@
 let chk_keyval key n url name =
   let int_n = (Int64.to_int n) in
   if !verbose_msg_clients then
-    lprintf_nl () "Reply from %s in file: %s has %s: %d" url name key int_n;
+    lprintf_nl "Reply from %s in file: %s has %s: %d" url name key int_n;
   if int_n > -1 then
     int_n
   else begin
-     lprintf_nl () "Reply from %s in file: %s has an invalid %s value: %d" url name key int_n;
+     lprintf_nl "Reply from %s in file: %s has an invalid %s value: %d" url name key int_n;
      0
    end
 
@@ -1319,13 +1309,13 @@
     let tracker_reply =
       try
         File.to_string filename
-      with e -> lprintf_nl () "Empty reply from tracker"; ""
+      with e -> lprintf_nl "Empty reply from tracker"; ""
     in
     let v =
        match tracker_reply with
        | "" ->
         if !verbose_connect then
-          lprintf_nl () "Empty reply from tracker";
+          lprintf_nl "Empty reply from tracker";
         Bencode.decode ""
        | _ -> Bencode.decode tracker_reply
     in
@@ -1340,10 +1330,10 @@
                 (* On failure, remove the faulty tracker from file.file_trackers list *)
 		t.tracker_enabled <- false;
 		(* remove_tracker t.tracker_url file; *)
-                lprintf_nl () "Failure from Tracker %s in file: %s Reason: %s\nBT: Tracker %s disabled for failure"
+                lprintf_nl "Failure from Tracker %s in file: %s Reason: %s\nBT: Tracker %s disabled for failure"
                   t.tracker_url file.file_name failure t.tracker_url
             | String "warning message", String warning ->
-                lprintf_nl () "Warning from Tracker %s in file: %s Reason: %s" t.tracker_url file.file_name warning
+                lprintf_nl "Warning from Tracker %s in file: %s Reason: %s" t.tracker_url file.file_name warning
             | String "interval", Int n ->
                 t.tracker_interval <- chk_keyval (Bencode.print key) n t.tracker_url file.file_name;
                 (* in case we don't receive "min interval" *)
@@ -1374,11 +1364,11 @@
             | String "key", String n ->
                 t.tracker_key <- n;
                 if !verbose_msg_clients then
-                  lprintf_nl () "%s in file: %s has key: %s" t.tracker_url file.file_name n
+                  lprintf_nl "%s in file: %s has key: %s" t.tracker_url file.file_name n
             | String "tracker id", String n ->
                 t.tracker_id <- n;
                 if !verbose_msg_clients then
-                  lprintf_nl () "%s in file: %s has tracker id %s" t.tracker_url file.file_name n
+                  lprintf_nl "%s in file: %s has tracker id %s" t.tracker_url file.file_name n
 
             | String "peers", List list ->
                 List.iter (fun v ->
@@ -1410,13 +1400,13 @@
                               None -> true
                             | Some reason ->
                                 if !verbose_connect then
-                                  lprintf_nl () "%s:%d blocked: %s"
+                                  lprintf_nl "%s:%d blocked: %s"
                                     (Ip.to_string !peer_ip) !port reason;
                                 false)
                         then
                           let _ = new_client file !peer_id (!peer_ip,!port)
                           in
-                          if !verbose_sources > 1 then lprintf_nl () "Received %s:%d" (Ip.to_string !peer_ip)
+                          if !verbose_sources > 1 then lprintf_nl "Received %s:%d" (Ip.to_string !peer_ip)
                           !port;
                           ()
                     | _ -> assert false
@@ -1437,12 +1427,12 @@
             | String "private", Int n -> ()
               (* TODO: if set to 1, disable peer exchange *)
 
-            | _ -> lprintf_nl () "received unknown entry in answer from tracker: %s : %s" (Bencode.print key) (Bencode.print value)
+            | _ -> lprintf_nl "received unknown entry in answer from tracker: %s : %s" (Bencode.print key) (Bencode.print value)
         ) list;
        (*Now, that we have added new clients to a file, it's time
          to connect to them*)
         if !verbose_sources > 0 then
-          lprintf_nl () "get_sources_from_tracker: got %i source(s) for file %s"
+          lprintf_nl "get_sources_from_tracker: got %i source(s) for file %s"
             t.tracker_last_clients_num file.file_name;
         resume_clients file
 
@@ -1471,7 +1461,7 @@
               (try
                   connect_trackers file "" (fun _ _ -> ()) with _ -> ())
           | FilePaused -> () (*when we are paused we do nothing, not even logging this vvvv*)
-          | s -> lprintf_nl () "Other state %s!!" (string_of_state s)
+          | s -> lprintf_nl "Other state %s!!" (string_of_state s)
       ) !current_files
 
 let upload_buffer = String.create 100000
@@ -1519,7 +1509,7 @@
 (*          lprintf "sending piece\n"; *)
           send_client c (Piece (num, pos, upload_buffer, 0, len));
           iter_upload sock c
-	with e -> if !verbose then lprintf_nl ()
+  with e -> if !verbose then lprintf_nl
 		    "Exception %s in iter_upload" (Printexc2.to_string e)
         end else
         begin
@@ -1571,7 +1561,7 @@
     if file.file_tracker_connected then
     begin
       connect_trackers file "stopped" (fun _ _ ->
-          lprintf_nl () "Tracker return: stopped %s" file.file_name;
+          lprintf_nl "Tracker return: stopped %s" file.file_name;
           file.file_tracker_connected <- false)
     end
 
@@ -1593,6 +1583,6 @@
   );
   client_ops.op_client_enter_upload_queue <- (fun c ->
       if !verbose_msg_clients then
-        lprintf_nl () "Client %d: client_enter_upload_queue" (client_num c);
+        lprintf_nl "Client %d: client_enter_upload_queue" (client_num c);
       ready_for_upload (as_client c));
   network.op_network_connected_servers <- (fun _ -> []);
Index: src/networks/bittorrent/bTComplexOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTComplexOptions.ml,v
retrieving revision 1.32
diff -u -u -w -r1.32 bTComplexOptions.ml
--- src/networks/bittorrent/bTComplexOptions.ml	12 May 2006 21:08:30 -0000	1.32
+++ src/networks/bittorrent/bTComplexOptions.ml	19 May 2006 21:58:27 -0000
@@ -68,11 +68,6 @@
     let t = define_option_class "Stat" value_to_stat stat_to_value
   end
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[BT] "
-    (log_time ()); lprintf_nl2
-
 module ClientOption = struct
 
     let value_to_client file v =
@@ -219,7 +214,7 @@
         (get_value  "file_sources" (
           value_to_list (ClientOption.of_value file)))
     with e ->
-        lprintf_nl () "Exception %s while loading sources"
+        lprintf_nl "Exception %s while loading sources"
           (Printexc2.to_string e);
   );
 *)
@@ -265,7 +260,7 @@
         CommonSwarming.swarmer_to_value swarmer assocs
   with
     e ->
-      lprintf_nl () "exception %s in file_to_value"
+      lprintf_nl "exception %s in file_to_value"
         (Printexc2.to_string e); raise e
 
 
Index: src/networks/bittorrent/bTGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTGlobals.ml,v
retrieving revision 1.57
diff -u -u -w -r1.57 bTGlobals.ml
--- src/networks/bittorrent/bTGlobals.ml	12 May 2006 21:08:30 -0000	1.57
+++ src/networks/bittorrent/bTGlobals.ml	19 May 2006 21:58:27 -0000
@@ -121,10 +121,14 @@
 let bt_download_counter = ref Int64.zero
 let bt_upload_counter = ref Int64.zero
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[BT] "
-    (log_time ()); lprintf_nl2
+let log_prefix = "[BT]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
+
 
 let check_if_interesting file c =
 
@@ -165,7 +169,7 @@
   file.file_trackers <- trackers @ file.file_trackers
 
 let create_temp_file file_temp file_files file_state =
-  if !verbose then lprintf_nl () "create_temp_file %s - %s" file_temp (string_of_state file_state);
+  if !verbose then lprintf_nl "create_temp_file %s - %s" file_temp (string_of_state file_state);
   let writable =
     if file_state = FileShared then
       false
@@ -661,7 +665,7 @@
   let default = (Brand_unknown, "") in
   let rec iter l =
     match l with
-      [] -> lprintf_nl () "Unknown BT client software version, report the next line to http://mldonkey.sourceforge.net/UnknownBtClients%s\nBTUC:\"%s\"" Autoconf.current_version (String.escaped s);
+      [] -> lprintf_nl "Unknown BT client software version, report the next line to http://mldonkey.sourceforge.net/UnknownBtClients%s\nBTUC:\"%s\"" Autoconf.current_version (String.escaped s);
             default
       | d :: t -> match (d s) with 
                   | None -> iter t
@@ -741,7 +745,7 @@
 let remove_tracker url file =
   if !verbose_msg_servers then
     List.iter (fun tracker ->
-      lprintf_nl () "Old tracker list :%s" tracker.tracker_url
+      lprintf_nl "Old tracker list :%s" tracker.tracker_url
     ) file.file_trackers;
   List.iter (fun bad_tracker ->
     if bad_tracker.tracker_url = url then
@@ -749,7 +753,7 @@
   ) file.file_trackers;
   if !verbose_msg_servers then
     List.iter (fun tracker ->
-      lprintf_nl () "New tracker list :%s" tracker.tracker_url
+      lprintf_nl "New tracker list :%s" tracker.tracker_url
     ) file.file_trackers
 
 let torrents_directory = "torrents"
Index: src/networks/bittorrent/bTInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTInteractive.ml,v
retrieving revision 1.92
diff -u -u -w -r1.92 bTInteractive.ml
--- src/networks/bittorrent/bTInteractive.ml	19 May 2006 14:52:11 -0000	1.92
+++ src/networks/bittorrent/bTInteractive.ml	19 May 2006 21:58:27 -0000
@@ -50,16 +50,6 @@
 let _s x = _s "BTInteractive" x
 let _b x = _b "BTInteractive" x
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[BT] "
-      (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[BT] "
-    (log_time ()); lprintf
-
 exception Already_exists
 
 let op_file_all_sources file =
@@ -108,7 +98,7 @@
       set_file_state file FileShared;
 
       if Unix32.destroyed (file_fd file) then
-        if !verbose then lprintf_nl () "op_file_commit: FD is destroyed... repairing";
+        if !verbose then lprintf_nl "op_file_commit: FD is destroyed... repairing";
 
 (* During the commit operation, for security, the file_fd is destroyed. So
   we create it again to be able to share this file again. *)
@@ -117,7 +107,7 @@
         (create_temp_file new_name (List.map (fun (file,size,_) -> (file,size)) file.file_files) (file_state file));
 
       if Unix32.destroyed (file_fd file) then
-        lprintf_nl () "op_file_commit: FD is destroyed... could not repair!";
+        lprintf_nl "op_file_commit: FD is destroyed... could not repair!";
 
       let new_torrent_diskname =
         Filename.concat seeded_directory
@@ -126,7 +116,7 @@
       (try
           Unix2.rename file.file_torrent_diskname new_torrent_diskname;
         with _ ->
-          (lprintf_nl () "op_file_commit: failed to rename %s to %s"
+          (lprintf_nl "op_file_commit: failed to rename %s to %s"
               file.file_torrent_diskname new_torrent_diskname));
       file.file_torrent_diskname <- new_torrent_diskname;
 
@@ -376,10 +366,10 @@
     end
 
 let op_file_check file =
-  lprintf_nl () "Checking chunks of %s" file.file_name;
+  lprintf_nl "Checking chunks of %s" file.file_name;
   match file.file_swarmer with
     None ->
-      lprintf_nl () "verify_chunks: no swarmer to verify chunks"
+      lprintf_nl "verify_chunks: no swarmer to verify chunks"
   | Some swarmer ->
       CommonSwarming.verify_all_chunks swarmer true
 
@@ -474,13 +464,13 @@
     in
   if Sys.file_exists torrent_diskname then
     begin
-      if !verbose then lprintf_nl () "load_torrent_string: %s already exists, ignoring" torrent_diskname;
+      if !verbose then lprintf_nl "load_torrent_string: %s already exists, ignoring" torrent_diskname;
       raise Already_exists
     end;
   File.from_string torrent_diskname s;
 
   if !verbose then
-    lprintf_nl () "Starting torrent download with diskname: %s"
+    lprintf_nl "Starting torrent download with diskname: %s"
         torrent_diskname;
   let file = new_download file_id torrent torrent_diskname in
   BTClients.get_sources_from_tracker file;
@@ -490,7 +480,7 @@
 
 let load_torrent_file filename =
   if !verbose then
-    lprintf_nl () "load_torrent_file %s" filename;
+    lprintf_nl "load_torrent_file %s" filename;
   let s = File.to_string filename in
   (* Delete the torrent if it is in the downloads dir. because it gets saved
      again under the torrent name and we don't want to clutter up this dir. .*)
@@ -503,21 +493,21 @@
 (*This is the function which will be called by the http client
 for parsing the response*)
 (* Interested only in interval*)
-  if !verbose_msg_servers then lprintf_nl () "Filename %s" filename;
+  if !verbose_msg_servers then lprintf_nl "Filename %s" filename;
     let tracker_reply =
       try
         File.to_string filename
-      with e -> lprintf_nl () "Empty reply from tracker"; ""
+      with e -> lprintf_nl "Empty reply from tracker"; ""
     in
     let v =
        match tracker_reply with
        | "" ->
         if !verbose_connect then
-          lprintf_nl () "Empty reply from tracker";
+          lprintf_nl "Empty reply from tracker";
         Bencode.decode ""
        | _ -> Bencode.decode tracker_reply
     in
-  if !verbose_msg_servers then lprintf_nl () "Received: %s" (Bencode.print v);
+  if !verbose_msg_servers then lprintf_nl "Received: %s" (Bencode.print v);
   t.tracker_interval <- 600;
   match v with
     Dictionary list ->
@@ -525,9 +515,9 @@
           match (key, value) with
             String "interval", Int n ->
               t.tracker_interval <- Int64.to_int n;
-              if !verbose_msg_servers then lprintf_nl () ".. interval %d .." t.tracker_interval
+              if !verbose_msg_servers then lprintf_nl ".. interval %d .." t.tracker_interval
           | String "failure reason", String failure ->
-                lprintf_nl () "Failure from Tracker in file: %s Reason: %s" file.file_name failure
+                lprintf_nl "Failure from Tracker in file: %s Reason: %s" file.file_name failure
           (*TODO: merge with f from get_sources_from_tracker and parse the rest of the answer, too.
             also connect to the sources we receive or instruct tracker to send none, perhaps based
             on an config option. firewalled people could activate the option and then seed torrents, too.*)
@@ -536,7 +526,7 @@
   | _ -> assert false
 
 let try_share_file torrent_diskname =
-  if !verbose_share then lprintf_nl () "try_share_file: %s" torrent_diskname;
+  if !verbose_share then lprintf_nl "try_share_file: %s" torrent_diskname;
   let s = File.to_string torrent_diskname in
   let file_id, torrent = BTTorrent.decode_torrent s in
 
@@ -553,7 +543,7 @@
               let filename =
                 Filename.concat sh.shdir_dirname torrent.torrent_name
               in
-              if !verbose_share then lprintf_nl () "Checking for %s" filename;
+              if !verbose_share then lprintf_nl "Checking for %s" filename;
               if Sys.file_exists filename then filename else
                 iter tail
             else
@@ -565,13 +555,13 @@
     let file = new_file file_id torrent torrent_diskname
         filename FileShared in
     BTShare.must_share_file file;
-    if !verbose_share then lprintf_nl () "Sharing file %s" filename;
+    if !verbose_share then lprintf_nl "Sharing file %s" filename;
     BTClients.connect_trackers file "started"
       (parse_tracker_reply file)
   with
   | Not_found ->
       (* if the torrent is still there while the file is gone, remove the torrent *)
-      if !verbose_share then lprintf_nl () "Removing torrent for %s" s;
+      if !verbose_share then lprintf_nl "Removing torrent for %s" s;
       let new_torrent_diskname =
         Filename.concat old_directory
           (Filename.basename torrent_diskname)
@@ -579,21 +569,21 @@
       (try
           Unix2.rename torrent_diskname new_torrent_diskname;
         with _ ->
-          (lprintf_nl () "Failed to rename %s to %s"
+          (lprintf_nl "Failed to rename %s to %s"
               torrent_diskname new_torrent_diskname));
 (*
       (try Sys.remove torrent_diskname with e ->
           if !verbose_share then
-            lprintf_nl () "Error: %s while removing torrent %s" (Printexc2.to_string e) s)
+            lprintf_nl "Error: %s while removing torrent %s" (Printexc2.to_string e) s)
 *)
   | e ->
-      lprintf_nl () "Cannot share torrent %s for %s"
+      lprintf_nl "Cannot share torrent %s for %s"
         torrent_diskname (Printexc2.to_string e)
 
 (* Call one minute after start, and then every 20 minutes. Should
   automatically contact the tracker. *)
 let share_files _ =
-  if !verbose_share then lprintf_nl () "share_files";
+  if !verbose_share then lprintf_nl "share_files";
   List.iter (fun dir ->
       let filenames = Unix2.list_directory dir in
       List.iter (fun file ->
@@ -604,11 +594,11 @@
   let shared_files_copy = !current_files in
  (* if the torrent is gone while the file is still shared, remove the share *)
   List.iter (fun file ->
-      (* if !verbose_share then lprintf_nl () "Checking torrent share for %s" file.file_torrent_diskname; *)
+      (* if !verbose_share then lprintf_nl "Checking torrent share for %s" file.file_torrent_diskname; *)
       if not (Sys.file_exists file.file_torrent_diskname) &&
         file_state file = FileShared then
         begin
-          if !verbose_share then lprintf_nl () "Removing torrent share for %s" file.file_torrent_diskname;
+          if !verbose_share then lprintf_nl "Removing torrent share for %s" file.file_torrent_diskname;
           BTClients.file_stop file;
           remove_file file;
           BTClients.disconnect_clients file;
@@ -624,18 +614,18 @@
     try
       load_torrent_file file;
       (try Sys.remove file with _ -> ())
-    with e -> lprintf_nl () "Error %s in scan_new_torrents_directory" (Printexc2.to_string e)
+    with e -> lprintf_nl "Error %s in scan_new_torrents_directory" (Printexc2.to_string e)
   ) filenames
 
 let retry_all_ft () =
   Hashtbl.iter (fun _ ft ->
       try ft.ft_retry ft with e ->
-          lprintf_nl () "ft_retry: exception %s" (Printexc2.to_string e)
+          lprintf_nl "ft_retry: exception %s" (Printexc2.to_string e)
   ) ft_by_num
 
 let file_magic_check () =
   if !Autoconf.magic_works then begin
-    if !verbose then lprintf_nl () "computing sub_file magic values";
+    if !verbose then lprintf_nl "computing sub_file magic values";
     let check_magic file = 
       match Magic.M.magic_fileinfo file false with
         None -> None
@@ -661,14 +651,14 @@
 
 let load_torrent_from_web r ft =
   if !verbose then
-      lprintf_nl () "Loading torrent from web";
+      lprintf_nl "Loading torrent from web";
   let module H = Http_client in
 
   if !verbose then
-      lprintf_nl () "calling...";
+      lprintf_nl "calling...";
   H.wget r (fun filename ->
       if !verbose then
-          lprintf_nl () "done...";
+          lprintf_nl "done...";
       if ft_state ft = FileDownloading then begin
           load_torrent_file filename;
           file_cancel (as_ft ft)
@@ -676,7 +666,7 @@
 
 let valid_torrent_extension url =
   let ext = String.lowercase (Filename2.last_extension url) in
-  if !verbose then lprintf_nl () "Last extension: %s" ext;
+  if !verbose then lprintf_nl "Last extension: %s" ext;
   if ext = ".torrent" || ext = ".tor" then true else false
 
 let get_regexp_string text r =
@@ -689,7 +679,7 @@
   let location_regexp = "Location: \\(.*\\)" in
   try
     let real_url = get_regexp_string url (Str.regexp location_regexp) in
-    if !verbose then lprintf_nl () "Loading %s, really %s" url real_url;
+    if !verbose then lprintf_nl "Loading %s, really %s" url real_url;
     if (valid_torrent_extension real_url)
        || (String2.contains url "Content-Type: application/x-bittorrent")
       then (
@@ -724,7 +714,7 @@
         let ft = new_ft file_diskname in
         ft.ft_retry <- load_torrent_from_web r ;
         load_torrent_from_web r ft;
-        if !verbose then lprintf_nl () "wget started";
+        if !verbose then lprintf_nl "wget started";
         "started download", true
       )
     else
@@ -733,23 +723,23 @@
     | Not_found ->
       if (valid_torrent_extension url) then
         try
-          if !verbose then lprintf_nl () "Not_found and trying to load %s" url;
+          if !verbose then lprintf_nl "Not_found and trying to load %s" url;
           try
             load_torrent_file url;
             "", true
           with Already_exists -> "A torrent with this name is already in the download queue", false
         with e ->
-          lprintf_nl () "Exception %s while 2nd loading" (Printexc2.to_string e);
+          lprintf_nl "Exception %s while 2nd loading" (Printexc2.to_string e);
 	  let s = Printf.sprintf "Can not load load torrent file: %s"
 	    (Printexc2.to_string e) in
           s, false
       else
         begin
-          if !verbose then lprintf_nl () "Not_found and url has non valid torrent extension: %s" url;
+          if !verbose then lprintf_nl "Not_found and url has non valid torrent extension: %s" url;
           "Not_found and url has non valid torrent extension", false
         end
     | e ->
-       lprintf_nl () "Exception %s while loading" (Printexc2.to_string e);
+       lprintf_nl "Exception %s while loading" (Printexc2.to_string e);
        let s = Printf.sprintf "Can not load load torrent file: %s"
 	 (Printexc2.to_string e) in
        s, false
@@ -851,7 +841,7 @@
 
 let compute_torrent filename announce comment = 
   let announce = if announce = "" then get_default_tracker () else announce in
-  if !verbose then lprintf_nl () "compute_torrent: [%s] [%s] [%s]"
+  if !verbose then lprintf_nl "compute_torrent: [%s] [%s] [%s]"
    filename announce comment;
   let basename = Filename.basename filename in
   let torrent = Filename.concat seeded_directory
@@ -1002,7 +992,7 @@
           Hashtbl.iter (fun _ file ->
               if file_num file = num then begin
                   if !verbose then
-                    lprintf_nl () "adding trackers for file %i" num;
+                    lprintf_nl "adding trackers for file %i" num;
                   set_trackers file !urls;
                   raise Exit
                 end
@@ -1025,7 +1015,7 @@
             _s ""
         | _ ->
             if !verbose then
-              lprintf_nl () "Not enough or wrong parameters.";
+              lprintf_nl "Not enough or wrong parameters.";
             let buf = o.conn_buf in
             if o.conn_output = HTML then
               html_mods_table_one_row buf "serversTable" "servers" [
@@ -1051,7 +1041,7 @@
   match get_int16 s 0 with
     0 ->
       let text = String.sub s 2 (String.length s - 2) in
-      if !verbose then lprintf_nl () "received torrent from gui...";
+      if !verbose then lprintf_nl "received torrent from gui...";
       ignore (load_torrent_string text)
   | 1 -> (* 34+ *)
       let n = get_int s 2 in
@@ -1109,7 +1099,7 @@
   CommonNetwork.register_commands commands;
 
   shared_ops.op_shared_unshare <- (fun file ->
-      (if !verbose_share then lprintf_nl () "unshare file");
+      (if !verbose_share then lprintf_nl "unshare file");
       BTShare.unshare_file file);
   shared_ops.op_shared_info <- (fun file ->
    let module T = GuiTypes in
Index: src/networks/bittorrent/bTMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTMain.ml,v
retrieving revision 1.20
diff -u -u -w -r1.20 bTMain.ml
--- src/networks/bittorrent/bTMain.ml	12 May 2006 21:08:30 -0000	1.20
+++ src/networks/bittorrent/bTMain.ml	19 May 2006 21:58:27 -0000
@@ -32,6 +32,11 @@
 open BTTypes
 open CommonTypes
 
+let log_prefix = "[bTM]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
 let is_enabled = ref false
 
 let disable enabler () =
@@ -70,8 +75,8 @@
     if !!BTTracker.tracker_port = !!client_port then
       begin
         lprint_newline();
-	lprintf_nl () "BT-client_port and BT-tracker_port can not be the same.";
-	lprintf_nl () "Change one of the settings and restart MLDonkey, exiting...\n";
+  lprintf_nl "BT-client_port and BT-tracker_port can not be the same.";
+  lprintf_nl "Change one of the settings and restart MLDonkey, exiting...\n";
 	Pervasives.exit 69
       end;
     if !!BTTracker.tracker_port > 0 then (
Index: src/networks/bittorrent/bTTracker.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTTracker.ml,v
retrieving revision 1.22
diff -u -u -w -r1.22 bTTracker.ml
--- src/networks/bittorrent/bTTracker.ml	1 Jan 2006 19:36:03 -0000	1.22
+++ src/networks/bittorrent/bTTracker.ml	19 May 2006 21:58:27 -0000
@@ -59,9 +59,10 @@
   *)
 
 (* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[bTTrack] "
-    (log_time ()); lprintf_nl2
+let log_prefix = "[bTTrack]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
 
 open Http_server
 
@@ -127,7 +128,7 @@
   try
     Int64.of_string v
   with e ->
-      lprintf_nl () "Exception %s in int64_of_string [%s]"
+      lprintf_nl "Exception %s in int64_of_string [%s]"
         (Printexc2.to_string e) v;
       raise e
 
@@ -135,7 +136,7 @@
   try
     int_of_string v
   with e ->
-      lprintf_nl () "Exception %s in int_of_string [%s]"
+      lprintf_nl "Exception %s in int_of_string [%s]"
         (Printexc2.to_string e) v;
       raise e
 
@@ -150,16 +151,16 @@
 
   let tracker_ok = ref true in
   if !verbose_msg_servers then
-    lprintf_nl () "tracker contacted for [%s]" (Sha1.to_hexa info_hash);
+    lprintf_nl "tracker contacted for [%s]" (Sha1.to_hexa info_hash);
   let tracker = try
       Hashtbl.find tracked_files info_hash
     with Not_found ->
         if !!tracker_force_local_torrents then begin
             tracker_ok := false;
-            lprintf_nl () "Tracker rejected announce request for torrent [%s]\n" (Sha1.to_hexa info_hash);
+            lprintf_nl "Tracker rejected announce request for torrent [%s]\n" (Sha1.to_hexa info_hash);
             failwith "Unknown torrent"
           end;
-        lprintf_nl () "[BT] Need new tracker";
+        lprintf_nl "[BT] Need new tracker";
         if !ntracked_files < !!max_tracked_files && !tracker_ok then
           let tracker = {
               tracker_id = info_hash;
@@ -206,7 +207,7 @@
         else
           tracker.tracker_complete <- tracker.tracker_complete + 1;
         if !verbose_msg_servers then
-          lprintf_nl () "Tracker adding new peer [%s]" (Sha1.to_string peer_id);
+          lprintf_nl "Tracker adding new peer [%s]" (Sha1.to_string peer_id);
         Hashtbl.add tracker.tracker_table peer_id peer;
         Fifo.put tracker.tracker_peers peer;
         peer
@@ -233,7 +234,7 @@
         if tracker.tracker_message_time < last_time () then
 
           let list = ref [] in
-          lprintf_nl () "Tracker collecting peers:";
+          lprintf_nl "Tracker collecting peers:";
           (try
               let max_peer_replies =
                 if numwant > 0 then
@@ -244,14 +245,14 @@
               for i = 1 to max_peer_replies do
                 let peer = Fifo.take tracker.tracker_peers in
                 if !verbose_msg_servers then
-                  lprintf_nl () "   %s:%d" (Ip.to_string peer.peer_ip)peer.peer_port;
+                  lprintf_nl "   %s:%d" (Ip.to_string peer.peer_ip)peer.peer_port;
                 list := peer :: !list
               done
             with _ -> ());
 
-          lprintf_nl () "Tracker sending %d peers" (List.length !list);
+          lprintf_nl "Tracker sending %d peers" (List.length !list);
           List.iter (fun p ->
-              lprintf_nl () "Tracker send: %s:%d"
+              lprintf_nl "Tracker send: %s:%d"
                 (Ip.to_string p.peer_ip) p.peer_port;
               Fifo.put tracker.tracker_peers p
           ) !list;
@@ -338,7 +339,7 @@
             | "natmapped" -> natmapped := int_of_string arg
             | "localip" -> localip := (Ip.of_string arg)
             | _ -> if !verbose_msg_servers then
-                     lprintf_nl () "[BT] Tracker: Unexpected [%s=%s]" name arg
+                     lprintf_nl "[BT] Tracker: Unexpected [%s=%s]" name arg
         ) args;
 
         if !ip = Ip.null && !localip = Ip.null then
@@ -348,15 +349,15 @@
           (* use localip if available *)
           ip := !localip;
         if !verbose_msg_servers then begin
-            lprintf_nl () "Connection received by tracker from client %s:%d with key [%s]:"
+            lprintf_nl "Connection received by tracker from client %s:%d with key [%s]:"
               (Ip.to_string !ip) !port !key;
-            lprintf_nl () "    info_hash: %s" (Sha1.to_hexa !info_hash);
-            lprintf_nl () "    peer_id: %s" (Sha1.to_hexa !peer_id);
-            lprintf_nl () "    event: %s" !event;
-            lprintf_nl () "    numwant: %d" !numwant;
-            lprintf_nl () "    compact: %d" (Int64.to_int !compact);
-            lprintf_nl () "    downloaded: %d" (Int64.to_int !downloaded);
-            lprintf_nl () "    uploaded: %d" (Int64.to_int !uploaded)
+            lprintf_nl "    info_hash: %s" (Sha1.to_hexa !info_hash);
+            lprintf_nl "    peer_id: %s" (Sha1.to_hexa !peer_id);
+            lprintf_nl "    event: %s" !event;
+            lprintf_nl "    numwant: %d" !numwant;
+            lprintf_nl "    compact: %d" (Int64.to_int !compact);
+            lprintf_nl "    downloaded: %d" (Int64.to_int !downloaded);
+            lprintf_nl "    uploaded: %d" (Int64.to_int !uploaded)
           end;
         (* Check hash then send reply *)
         (try
@@ -401,9 +402,9 @@
         ) tracked_files;
 
         if !verbose_msg_servers then begin
-            lprintf_nl () "Scrape request received by tracker";
-            lprintf_nl () "Sending scrape list:";
-            lprintf_nl () "f: (file hash) d: (downloaded) c: (complete) i: (incomplete)";
+            lprintf_nl "Scrape request received by tracker";
+            lprintf_nl "Sending scrape list:";
+            lprintf_nl "f: (file hash) d: (downloaded) c: (complete) i: (incomplete)";
             lprint_string !log_tracked_files;
           end;
         let message = Dictionary [ String "files", List !files_tracked ] in
@@ -412,13 +413,13 @@
 
     | "favicon.ico" ->
         if !verbose_msg_servers then
-            lprintf_nl () "favicon.ico request received by tracker";
+            lprintf_nl "favicon.ico request received by tracker";
             add_reply_header r "Content-Type" "image/x-icon";
             r.reply_content <- File.to_string "favicon.ico"
 
     | filename ->
         if !verbose_msg_servers then
-          lprintf_nl () "Tracker received a request for .torrent: [%s]" filename;
+          lprintf_nl "Tracker received a request for .torrent: [%s]" filename;
         if (Filename2.last_extension filename <> ".torrent") then
           failwith "Incorrect filename 1";
         for i = 1 to String.length filename - 1 do
@@ -451,7 +452,7 @@
 
   with e ->
       if !verbose_msg_servers then
-        lprintf_nl () "for request [%s] exception %s"
+        lprintf_nl "for request [%s] exception %s"
           (Url.to_string r.get_url) (Printexc2.to_string e);
       match e with
         Not_found ->
@@ -590,7 +591,7 @@
   let time_threshold = last_time () - 3600 in
   let trackers = ref [] in
 
-  if !verbose_msg_servers then lprintf_nl () "clean_tracker_timer";
+  if !verbose_msg_servers then lprintf_nl "clean_tracker_timer";
   Hashtbl.iter (fun _ tracker ->
       let list = ref [] in
       let old_peers = ref [] in
Index: src/networks/donkey/donkeyClient.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyClient.ml,v
retrieving revision 1.88
diff -u -u -w -r1.88 donkeyClient.ml
--- src/networks/donkey/donkeyClient.ml	9 Apr 2006 00:27:03 -0000	1.88
+++ src/networks/donkey/donkeyClient.ml	19 May 2006 21:58:28 -0000
@@ -55,16 +55,6 @@
 
 module Udp = DonkeyProtoUdp
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf
-
 (* Lifetime of a socket after sending interesting messages *)
 let active_lifetime = 1200.
 
@@ -125,7 +115,7 @@
     let module M = DonkeyProtoClient in
     
     if !verbose then
-        lprintf_nl () "banned: %s %s" msg (full_client_identifier c);
+        lprintf_nl "banned: %s %s" msg (full_client_identifier c);
     
     count_banned c;
     c.client_banned <- true;
@@ -160,7 +150,7 @@
               raise Exit;
             end;
           if !verbose then
-              lprintf_nl () "warning no. %d, connecting too fast (last connect %d sec. ago): %s"
+              lprintf_nl "warning no. %d, connecting too fast (last connect %d sec. ago): %s"
           record.nwarnings old_time (full_client_identifier c);
           if !!send_warning_messages then
             client_send c ( M.SayReq  (
@@ -196,7 +186,7 @@
           M.AvailableSlotReq Q.t);
         
         if !verbose then
-            lprintf_nl () "New uploader %s"
+            lprintf_nl "New uploader %s"
               (full_client_identifier c);
         
     )  
@@ -246,7 +236,7 @@
   | Connection sock ->
       (try
     let log_print cc =
-            lprintf_nl () "Client[%d] %s disconnected, connected %s%s%s"
+            lprintf_nl "Client[%d] %s disconnected, connected %s%s%s"
         (client_num cc)
         (full_client_identifier cc)
         (Date.time_to_string (last_time () - cc.client_connect_time) "verbose")
@@ -288,7 +278,7 @@
           c.client_file_queue <- [];  
           if c.client_upload != None then CommonUploads.refill_upload_slots ();
         
-        with e -> lprintf_nl () "Exception %s in disconnect_client"
+        with e -> lprintf_nl "Exception %s in disconnect_client"
               (Printexc2.to_string e));
 (*      lprintf "Client %d to source:" (client_num c);
       List.iter (fun r ->
@@ -383,7 +373,7 @@
                   ) group.group;
                   if !list <> [] then begin
                       if !verbose_sources > 2 then
-                          lprintf_nl () "Send %d sources from file groups to mldonkey peer" (List.length !list); 
+                          lprintf_nl "Send %d sources from file groups to mldonkey peer" (List.length !list); 
                       let msg = 
                         let module Q = DonkeyProtoClient.Sources in
                         DonkeyProtoClient.SourcesReq {
@@ -404,7 +394,7 @@
               UdpClientMap.iter (fun _ uc ->
                   if uc.udp_client_can_receive then begin
                       if !verbose_sources > 2 then
-                        lprintf_nl () "Send new source to file groups UDP peers";
+                        lprintf_nl "Send new source to file groups UDP peers";
                       udp_client_send uc (
                         Udp.QueryLocationReplyUdpReq (
                           let module Q = DonkeyProtoServer.QueryLocationReply in
@@ -684,7 +674,7 @@
             update_emule_release c;
               
             if c.client_brand = Brand_unknown then
-              lprintf_nl () "[emule_version] Brand_unknown %s" (full_client_identifier c);
+              lprintf_nl "[emule_version] Brand_unknown %s" (full_client_identifier c);
           )
       | Field_UNKNOWN "mod_version" ->
           let s = to_lowercase (string_of_tag_value tag.tag_value) in 
@@ -700,7 +690,7 @@
           for_int_tag tag (fun i ->
             c.client_brand <- parse_compatible_client i c.client_brand;
             if c.client_brand = Brand_unknown then
-              lprintf_nl () "unknown compatibleclient %d (%s) (please report to dev team)" i (full_client_identifier c)
+              lprintf_nl "unknown compatibleclient %d (%s) (please report to dev team)" i (full_client_identifier c)
           )
       | Field_UNKNOWN "compression" ->
           for_int_tag tag (fun i ->
@@ -732,7 +722,7 @@
           parse_mod_version s c;
       | _ -> 
           if !verbose_msg_clients then
-            lprintf_nl () "Unknown Emule tag: [%s]" (escaped_string_of_field tag)
+            lprintf_nl "Unknown Emule tag: [%s]" (escaped_string_of_field tag)
   ) tags
 
 let fight_disguised_mods c =
@@ -838,7 +828,7 @@
         (* ask for more sources *)
         begin
           if !verbose_location then
-             lprintf_nl () "donkeyClient: Requesting sources from client %s that queried file %s"
+             lprintf_nl "donkeyClient: Requesting sources from client %s that queried file %s"
                  (full_client_identifier c) (file_best_name file);
           let module E = M.EmuleRequestSources in
           client_send c (M.EmuleRequestSourcesReq file.file_md4)
@@ -875,11 +865,11 @@
   let module M = DonkeyProtoClient in
   
   if !verbose_msg_clients then begin
-      lprintf_nl () "Compared to:";
+      lprintf_nl "Compared to:";
       match file.file_swarmer with
         None -> ()
       | Some swarmer ->
-          lprintf_nl () "   %s" (CommonSwarming.verified_bitmap swarmer);
+          lprintf_nl "   %s" (CommonSwarming.verified_bitmap swarmer);
     end;
   
   let chunks = 
@@ -890,7 +880,7 @@
     else
     if Bitv.length chunks <> file.file_nchunks then begin
         if !verbose then
-      lprintf_nl () "number of chunks is different %d/%d for %s(%s), size %Ld on %s"
+      lprintf_nl "number of chunks is different %d/%d for %s(%s), size %Ld on %s"
               (Bitv.length chunks)
               file.file_nchunks 
         (file_best_name file)
@@ -1003,7 +993,7 @@
     let signature = DonkeySui.SUI.create_signature pubkey (String.length pubkey) c.client_req_challenge !ip_type !ip in
     
     if !verbose_msg_clients then begin
-      lprintf_nl () "%s [send_signature] [sigLen: %d] [keyLen: %d] [reqChall: %Ld] [ipType: %d] [ip: %Ld]" (full_client_identifier c) (String.length signature) (String.length pubkey) c.client_req_challenge !ip_type !ip;
+      lprintf_nl "%s [send_signature] [sigLen: %d] [keyLen: %d] [reqChall: %Ld] [ipType: %d] [ip: %Ld]" (full_client_identifier c) (String.length signature) (String.length pubkey) c.client_req_challenge !ip_type !ip;
     end;
   
     let module M = DonkeyProtoClient in
@@ -1015,7 +1005,7 @@
   end
     else
       if !verbose_msg_clients then begin
-        lprintf_nl () "%s [send_signature] Can't send without a key" (full_client_identifier c)
+        lprintf_nl "%s [send_signature] Can't send without a key" (full_client_identifier c)
       end
 
 let verify_ident c =
@@ -1024,7 +1014,7 @@
   c.client_sent_challenge <- challenge;
 
   if !verbose_msg_clients then begin
-    lprintf_nl () "%s [verify_ident] [state: %d (%s)] [sentChall: %Ld]" (full_client_identifier c) state state_string challenge;
+    lprintf_nl "%s [verify_ident] [state: %d (%s)] [sentChall: %Ld]" (full_client_identifier c) state state_string challenge;
   end;
 
   let module M = DonkeyProtoClient in
@@ -1036,7 +1026,7 @@
 
 let send_public_key c =
   if !verbose_msg_clients then begin
-    lprintf_nl () "%s [send_public_key] [keyLen: %d]" (full_client_identifier c) (String.length !client_public_key);
+    lprintf_nl "%s [send_public_key] [keyLen: %d]" (full_client_identifier c) (String.length !client_public_key);
   end;
 
   let module M = DonkeyProtoClient in
@@ -1063,7 +1053,7 @@
       && (c.client_emule_proto.emule_secident > 0) 
   then begin
     if !verbose_msg_clients then begin
-      lprintf_nl () "%s [process_mule_info] [verify_ident]" (full_client_identifier c);
+      lprintf_nl "%s [process_mule_info] [verify_ident]" (full_client_identifier c);
     end;
     verify_ident c
   end
@@ -1102,14 +1092,14 @@
   let module M = DonkeyProtoClient in
   
   if !verbose_msg_clients || c.client_debug then begin
-      lprintf_nl () "Message from %s" (string_of_client c);
+      lprintf_nl "Message from %s" (string_of_client c);
       M.print t;
     end;
   
   match t with
     M.ConnectReplyReq t ->
       if !verbose_msg_clients then begin
-        lprintf_nl () "[HELLOANSWER] %s" (full_client_identifier c); 
+        lprintf_nl "[HELLOANSWER] %s" (full_client_identifier c); 
       end;
     
       incr_activity_successful_connections c;
@@ -1202,7 +1192,7 @@
       process_mule_info c t.CI.tags;
       
       if !verbose_msg_clienttags then
-          lprintf_nl () "Message from client[%d] %s %s  tags: %s"
+          lprintf_nl "Message from client[%d] %s %s  tags: %s"
             (client_num c)
             (match c.client_kind with
               Indirect_address _ | Invalid_address _ -> ""
@@ -1244,7 +1234,7 @@
       if !sources <> [] then
         begin
           if !verbose_location then
-            lprintf_nl () "donkeyClient: EmuleRequestSourcesReq: Sending %d Sources to %s for file %s"
+            lprintf_nl "donkeyClient: EmuleRequestSourcesReq: Sending %d Sources to %s for file %s"
               (List.length !sources) (full_client_identifier c) (file_best_name file);
           client_send c (
             M.EmuleRequestSourcesReplyReq {
@@ -1261,7 +1251,7 @@
       let module Q = M.ViewFilesReply in
       begin
         if !verbose_msg_clients then
-            lprintf_nl () "Received ViewFilesReply";
+            lprintf_nl "Received ViewFilesReply";
         try
           let list = ref [] in
           List.iter (fun f ->
@@ -1276,7 +1266,7 @@
           client_must_update c
         
         with e ->
-            lprintf_nl () "Exception in ViewFilesReply %s"
+            lprintf_nl "Exception in ViewFilesReply %s"
               (Printexc2.to_string e); 
       end;
   
@@ -1295,7 +1285,7 @@
         match c.client_download with
         | Some (file,up) -> 
             if !verbose_download then
-                lprintf_nl () "Clear download";
+                lprintf_nl "Clear download";
             CommonSwarming.clear_uploader_ranges up;
             c.client_download <- None
         | None ->
@@ -1307,13 +1297,13 @@
                     let files, _ = try
                         let v = Hashtbl.find join_queue_by_md4 c.client_md4 in
                         if c.client_debug then
-                          lprintf_nl () "Recovered file queue by md4";
+                          lprintf_nl "Recovered file queue by md4";
                         v
                       with _ ->
                           let id = client_id c in
                           let v = Hashtbl.find join_queue_by_id id in
                           if c.client_debug then
-                            lprintf_nl () "Recovered file queue by md4";
+                            lprintf_nl "Recovered file queue by md4";
                           v
                     in
                     List.iter (fun (file, chunks) ->
@@ -1322,7 +1312,7 @@
 (*                DonkeyOneFile.restart_download c *)
                   with _ -> 
                       if c.client_debug then
-                        lprintf_nl () "AvailableSlot received, but not file to download!";
+                        lprintf_nl "AvailableSlot received, but not file to download!";
 (* TODO: ask for the files now *)
       end;
 (* now, we can forget we have asked for a slot *)
@@ -1372,7 +1362,7 @@
         end else *)
       CommonUploads.add_pending_slot (as_client c);
       if !verbose_upload then
-          lprintf_nl () "donkeyClient: uploader couldn't get a slot: %s"
+          lprintf_nl "donkeyClient: uploader couldn't get a slot: %s"
             (full_client_identifier c);
 (*      end *)
   
@@ -1383,7 +1373,7 @@
           None -> ()
         | Some (file,up) ->
             if !verbose_download then
-                lprintf_nl () "Slot closed during download";
+                lprintf_nl "Slot closed during download";
             CommonSwarming.clear_uploader_ranges up
       end;
 (*      DonkeyOneFile.clean_current_download c; *)
@@ -1394,7 +1384,7 @@
           [] -> ()
         | _ -> 
             if !verbose_download then
-                lprintf_nl () "CloseSlotReq"; 
+                lprintf_nl "CloseSlotReq"; 
             DonkeyOneFile.request_slot c;
             set_rtimeout sock !!queued_timeout;
       end
@@ -1452,7 +1442,7 @@
               received_client_bitmap c file t.Q.chunks
           with e ->
       client_send c (M.NoSuchFileReq t.Q.md4);
-      if !verbose then lprintf_nl ()
+      if !verbose then lprintf_nl
         "QueryChunksReply: Client (%s) asked for file_md4 %s, Exception %s"
         (full_client_identifier c)
         (Md4.to_string t.Q.md4)
@@ -1466,12 +1456,12 @@
         
         let module Q = M.QueryChunkMd4Reply in
         if !verbose then
-            lprintf_nl () "Received chunks md4 for %s from %s"
+            lprintf_nl "Received chunks md4 for %s from %s"
                 (file_best_name file) (full_client_identifier c);
         
         if file.file_computed_md4s = [||] then begin
         if file.file_nchunks = 1 then begin
-            lprintf_nl () "[ERROR] file %s has only one chunk, ignoring QueryChunkMd4ReplyReq"
+            lprintf_nl "[ERROR] file %s has only one chunk, ignoring QueryChunkMd4ReplyReq"
         (file_best_name file);
             file.file_computed_md4s <- [|file.file_md4|];
             match file.file_swarmer with
@@ -1481,12 +1471,12 @@
                   (Verification [| Ed2k file.file_md4 |])
           end else
         if t.Q.chunks = [||] then
-            lprintf_nl () "[ERROR] received empty chunks md4 message for %s from %s"
+            lprintf_nl "[ERROR] received empty chunks md4 message for %s from %s"
         (file_best_name file) (full_client_identifier c)
         else
         if Array.length t.Q.chunks <> file.file_nchunks then begin
             if !verbose then
-        lprintf_nl () "[ERROR] number of chunks does not match, received md4s %d/should be %d, for %s(%s):%Ld bytes from %s"
+        lprintf_nl "[ERROR] number of chunks does not match, received md4s %d/should be %d, for %s(%s):%Ld bytes from %s"
           (Array.length t.Q.chunks)
     file.file_nchunks
     (file_best_name file)
@@ -1511,7 +1501,7 @@
             let md4s = t.Q.chunks in
             let md4 = DonkeyShare.md4_of_array md4s in
             if md4 <> file.file_md4 then begin
-                lprintf_nl () "[ERROR] Chunks md4s do not match file_md4 for %s(%s) from %s"
+                lprintf_nl "[ERROR] Chunks md4s do not match file_md4 for %s(%s) from %s"
       (file_best_name file) (Md4.to_string file.file_md4) (full_client_identifier c);
               end else begin
                 file.file_computed_md4s <- md4s;
@@ -1533,7 +1523,7 @@
       set_lifetime sock active_lifetime;      
       if !!reliable_sources && 
         client_reliability c = Reliability_suspicious 0 then begin
-          lprintf_nl () "Receiving data from unreliable client, disconnect";
+          lprintf_nl "Receiving data from unreliable client, disconnect";
           corruption_warning c;
           disconnect_client c (Closed_for_error "Unreliable Source");
           raise Not_found
@@ -1558,7 +1548,7 @@
 (*            lprintf "Comp bloc: %d/%d\n" comp.comp_len comp.comp_total; *)
       if comp.comp_len = comp.comp_total then begin
           if !verbose_download then
-            lprintf_nl () "Complete compressed block received!";
+            lprintf_nl "Complete compressed block received!";
           
           let s = String.create comp.comp_len in
           let rec iter list =
@@ -1574,7 +1564,7 @@
           assert (pos = comp.comp_len);
             let s = Autoconf.zlib__uncompress_string2 s in
             if !verbose_download then
-        lprintf_nl () "Decompressed: %d/%d" (String.length s) comp.comp_len;
+        lprintf_nl "Decompressed: %d/%d" (String.length s) comp.comp_len;
             
             DonkeyOneFile.block_received c comp.comp_md4
               comp.comp_pos s 0 (String.length s);
@@ -1583,7 +1573,7 @@
         end else
       if comp.comp_len > comp.comp_total then begin
           if !verbose_unknown_messages then
-            lprintf_nl () "eMule compressed data, ignoring, more data (%d) than compressed (%d) from %s for %s"
+            lprintf_nl "eMule compressed data, ignoring, more data (%d) than compressed (%d) from %s for %s"
         comp.comp_len comp.comp_total (full_client_identifier c) (Md4.to_string comp.comp_md4);
           c.client_comp <- None;
         end
@@ -1593,7 +1583,7 @@
       set_lifetime sock active_lifetime;      
       if !!reliable_sources && 
         client_reliability c = Reliability_suspicious 0 then begin
-          lprintf_nl () "Receiving data from unreliable client, disconnect";
+          lprintf_nl "Receiving data from unreliable client, disconnect";
           corruption_warning c;
           disconnect_client c (Closed_for_error "Unreliable Source");
           raise Not_found
@@ -1606,7 +1596,7 @@
       let end_pos = t.Q.end_pos in
       let len = end_pos -- begin_pos in
       if Int64.to_int len <> t.Q.bloc_len then begin
-          lprintf_nl () "%d: inconsistent packet sizes" (client_num c);
+          lprintf_nl "%d: inconsistent packet sizes" (client_num c);
           raise Not_found
         end;
       
@@ -1630,7 +1620,7 @@
        lprintf "ASK VIEW FILES\n"; 
        *)
       if !verbose_msg_clients then
-          lprintf_nl () "Sending %d Files in ViewFilesReqReply" (List.length !published_files);
+          lprintf_nl "Sending %d Files in ViewFilesReqReply" (List.length !published_files);
       client_send_files sock !published_files
   
   (*TODO: real directory support*)
@@ -1641,7 +1631,7 @@
       | _ -> false) -> 
       let published_dirs = ["FIXME"] in
       if !verbose_msg_clients then
-          lprintf_nl () "Sending %d Dirs in ViewDirsReplyReq" (List.length published_dirs);
+          lprintf_nl "Sending %d Dirs in ViewDirsReplyReq" (List.length published_dirs);
       client_send c (M.ViewDirsReplyReq published_dirs)
   
   (*TODO: real directory support*)
@@ -1662,7 +1652,7 @@
        lprintf "ASK VIEW FILES\n"; 
        *)
       if !verbose_msg_clients then
-          lprintf_nl () "Sending %d Files in ViewFilesReqReply" (List.length !published_files);
+          lprintf_nl "Sending %d Files in ViewFilesReqReply" (List.length !published_files);
       client_send_dir sock t !published_files
 
   | M.QueryFileReq t ->
@@ -1678,7 +1668,7 @@
           c.client_brand <- Brand_mldonkey1;
       if c.client_brand = Brand_mldonkey1 || c.client_brand = Brand_mldonkey2 then begin
           if !verbose then
-              lprintf_nl () "donkeyClient:QueryFileReq: Client %s is really old mldonkey1/2 and queried file %s"
+              lprintf_nl "donkeyClient:QueryFileReq: Client %s is really old mldonkey1/2 and queried file %s"
                   (full_client_identifier c) (Md4.to_string md4);
           if Random.int 100 < 3 && !!send_warning_messages then
             client_send c (
@@ -1719,10 +1709,10 @@
         with Not_found -> 
             client_send c (M.NoSuchFileReq md4);
             if !verbose_unexpected_messages then
-              lprintf_nl () "donkeyClient: QueryFileReq: Client %s queried unpublished file %s"
+              lprintf_nl "donkeyClient: QueryFileReq: Client %s queried unpublished file %s"
           (full_client_identifier c) (Md4.to_string md4)
         | e -> 
-            lprintf_nl () "Exception %s in QueryFileReq"
+            lprintf_nl "Exception %s in QueryFileReq"
               (Printexc.to_string e)
       end
 
@@ -1738,7 +1728,7 @@
           | 20 -> (20, "IpRemote")
           | e -> (e, "Unknown")) in
         let lkeyString = if (has_pubkey c) then "" else "[NO KEY!!]" in
-        lprintf_nl () "%s [ESigReq] [sentChall: %Ld] [ipType: %d (%s)] %s" (full_client_identifier c) c.client_sent_challenge lipType lipTypeString lkeyString;
+        lprintf_nl "%s [ESigReq] [sentChall: %Ld] [ipType: %d (%s)] %s" (full_client_identifier c) c.client_sent_challenge lipType lipTypeString lkeyString;
       end;
 
       let ip_type = ref 0 in
@@ -1755,7 +1745,7 @@
             if !id = Int64.zero then begin
                 id := int64_of_rip (my_ip sock);
                 if !verbose_msg_clients then begin
-                  lprintf_nl () "%s [ESigReq] Warning: Local IP unknown (signature might fail)" (full_client_identifier c);
+                  lprintf_nl "%s [ESigReq] Warning: Local IP unknown (signature might fail)" (full_client_identifier c);
                 end;
             end;
           end;
@@ -1764,7 +1754,7 @@
       let pubKey = get_pubkey c in
       
       if !verbose_msg_clients then begin
-        lprintf_nl () "%s [ESigReq] [verify_signature] [keyLen: %d] [sigLen: %d] [sentChall: %Ld] [ipType %d] [ip: %Ld]" (full_client_identifier c) (String.length pubKey) (String.length t.Q.signature) c.client_sent_challenge !ip_type !id;
+        lprintf_nl "%s [ESigReq] [verify_signature] [keyLen: %d] [sigLen: %d] [sentChall: %Ld] [ipType %d] [ip: %Ld]" (full_client_identifier c) (String.length pubKey) (String.length t.Q.signature) c.client_sent_challenge !ip_type !id;
       end;
 
       let verified = DonkeySui.SUI.verify_signature pubKey (String.length pubKey) t.Q.signature (String.length t.Q.signature) c.client_sent_challenge !ip_type !id in
@@ -1773,12 +1763,12 @@
       client_must_update c;
 
       if !verbose_msg_clients then begin
-        lprintf_nl () "%s [ESigReq] [verify_signature: %s]" (full_client_identifier c) (if verified then "passed" else "failed");
+        lprintf_nl "%s [ESigReq] [verify_signature: %s]" (full_client_identifier c) (if verified then "passed" else "failed");
       end;
 
       end else
       if !verbose_msg_clients then begin
-        lprintf_nl () "%s [ESigReq] [DISABLED]" (full_client_identifier c) ;
+        lprintf_nl "%s [ESigReq] [DISABLED]" (full_client_identifier c) ;
       end
 
   | M.EmulePublicKeyReq t ->
@@ -1789,18 +1779,18 @@
         Some s -> if s <> t then 
                   begin
                    if !verbose_msg_clients then begin
-                     lprintf_nl () "%s [EPubKeyReq] [Key is different!]" (full_client_identifier c);
+                     lprintf_nl "%s [EPubKeyReq] [Key is different!]" (full_client_identifier c);
                    end;
                    c.client_public_key <- None; 
                   end 
                     else 
                       if !verbose_msg_clients then begin
-                        lprintf_nl () "%s [EPubKeyReq] [Key matches]" (full_client_identifier c);
+                        lprintf_nl "%s [EPubKeyReq] [Key matches]" (full_client_identifier c);
                       end;
         | _ -> 
           c.client_public_key <- Some t;
           if !verbose_msg_clients then begin
-            lprintf_nl () "%s [EPubKeyReq] [New Key] [keyLen: %d] [reqChall: %Ld]" (full_client_identifier c) (String.length t) c.client_req_challenge;
+            lprintf_nl "%s [EPubKeyReq] [New Key] [keyLen: %d] [reqChall: %Ld]" (full_client_identifier c) (String.length t) c.client_req_challenge;
           end;
   
           if (c.client_req_challenge <> Int64.zero) then send_signature c;
@@ -1808,7 +1798,7 @@
       end
        else
       if !verbose_msg_clients then begin
-        lprintf_nl () "%s [EPubKeyReq] [DISABLED]" (full_client_identifier c) ;
+        lprintf_nl "%s [EPubKeyReq] [DISABLED]" (full_client_identifier c) ;
       end
 
   | M.EmuleSecIdentStateReq t ->
@@ -1822,7 +1812,7 @@
               1 -> (1,"SIGNNEEDED") 
             | 2 -> (2,"KEYANDSIGNNEEDED") 
             | e -> (e,"UNKNOWN")) in
-          lprintf_nl () "%s [ESecIdentStateReq] [type: %d (%s)] [reqChall: %Ld] [sendChall: %Ld] [hasKey: %b]" 
+          lprintf_nl "%s [ESecIdentStateReq] [type: %d (%s)] [reqChall: %Ld] [sendChall: %Ld] [hasKey: %b]" 
             (full_client_identifier c) lstate lstateString t.Q.challenge c.client_sent_challenge (has_pubkey c);
         end;
 
@@ -1836,7 +1826,7 @@
 
       end else
       if !verbose_msg_clients then begin
-        lprintf_nl () "%s [ESecIdentStateReq] [DISABLED]" (full_client_identifier c) ;
+        lprintf_nl "%s [ESecIdentStateReq] [DISABLED]" (full_client_identifier c) ;
       end
 
   | M.EmuleRequestSourcesReplyReq t ->
@@ -1852,7 +1842,7 @@
               
 end else *)
             if !verbose_location then
-              lprintf_nl () "donkeyClient: EmuleRequestSourcesReply: Received %d sources from %s for %s"
+              lprintf_nl "donkeyClient: EmuleRequestSourcesReply: Received %d sources from %s for %s"
                     (Array.length t.Q.sources) (full_client_identifier c) (file_best_name file);
             
             Array.iter (fun s ->
@@ -1875,7 +1865,7 @@
               
             end else *)
             if !verbose_location then
-              lprintf_nl () "donkeyClient: SourcesReq: Received %d sources from %s for %s"
+              lprintf_nl "donkeyClient: SourcesReq: Received %d sources from %s for %s"
                     (List.length t.Q.sources) (full_client_identifier c) (file_best_name file);
             List.iter (fun (ip1, port, ip2) ->
                 add_source file ip1 port Ip.null 0
@@ -1969,7 +1959,7 @@
           with
             | _ ->
                 if !verbose_unexpected_messages then
-                  lprintf_nl () "donkeyClient:QueryChunksReq: chunks of unpublished file %s queried from %s"
+                  lprintf_nl "donkeyClient:QueryChunksReq: chunks of unpublished file %s queried from %s"
                     (Md4.to_string t) (full_client_identifier c);
                 client_send c ( M.NoSuchFileReq t );
         end
@@ -1978,7 +1968,7 @@
     client_has_a_slot (as_client c) ->
       
       if !verbose_upload then
-          lprintf_nl () "donkeyClient: uploader %s ask for block" (full_client_identifier c);
+          lprintf_nl "donkeyClient: uploader %s ask for block" (full_client_identifier c);
       
       let module Q = M.QueryBloc in
       let file = find_file  t.Q.md4 in
@@ -2036,14 +2026,14 @@
             up.up_waiting <- true
           end
       end;
-      if !verbose_upload then lprintf_nl () "QueryBloc treated"
+      if !verbose_upload then lprintf_nl "QueryBloc treated"
       
   | M.NoSuchFileReq t ->
       begin
         try
           let file = find_file t in
           if !verbose_location then
-            lprintf_nl () "donkeyClient: NoSuchFileReq: from %s for file %s"
+            lprintf_nl "donkeyClient: NoSuchFileReq: from %s for file %s"
                 (full_client_identifier c) (file_best_name file);
           DonkeySources.set_request_result c.client_source 
             file.file_sources File_not_found;
@@ -2052,7 +2042,7 @@
         
   | _ -> 
       if !verbose_unknown_messages then begin
-          lprintf_nl () "Unused client message %s:" (full_client_identifier c);
+          lprintf_nl "Unused client message %s:" (full_client_identifier c);
           M.print t;
         end
       
@@ -2137,7 +2127,7 @@
   let module M = DonkeyProtoClient in
     
   if !verbose_msg_clients then begin
-      lprintf_nl () "Message from incoming client";
+      lprintf_nl "Message from incoming client";
       M.print m;
     end;
 
@@ -2145,7 +2135,7 @@
   
   | M.ConnectReq t ->
       if !verbose_msg_clients then begin
-        lprintf_nl () "[HELLO] %s" (Ip.to_string (peer_ip sock));
+        lprintf_nl "[HELLO] %s" (Ip.to_string (peer_ip sock));
       end;
       
       let module CR = M.Connect in
@@ -2230,7 +2220,7 @@
           Some (ip, port) ->  if !!update_server_list_client then safe_add_server ip port
         | None -> 
             if overnet then begin
-                lprintf_nl () "incoming Overnet client";
+                lprintf_nl "incoming Overnet client";
                 DonkeySources.set_source_brand c.client_source overnet;
               end
       end;
@@ -2278,13 +2268,13 @@
       Some c
       
   | M.NewUserIDReq _ ->
-      lprintf_nl () "NewUserIDReq: "; M.print m; 
+      lprintf_nl "NewUserIDReq: "; M.print m; 
       None
   
   | _ -> 
       if !verbose_unknown_messages then
         begin
-          lprintf_nl () "BAD MESSAGE FROM CONNECTING CLIENT with ip:%s port:%i overnet:%b"
+          lprintf_nl "BAD MESSAGE FROM CONNECTING CLIENT with ip:%s port:%i overnet:%b"
             (Ip.to_string (peer_ip sock)) (peer_port sock) overnet;
           M.print m; lprint_newline ();
         end;
@@ -2383,12 +2373,12 @@
                       
                 with
       Unix.Unix_error (Unix.ENETUNREACH,_,_) ->
-        if !verbose then lprintf_nl () "Network unreachable for IP %s:%d"
+        if !verbose then lprintf_nl "Network unreachable for IP %s:%d"
           (Ip.to_string ip) port;
                     set_client_disconnected c (Closed_connect_failed);
                     DonkeySources.source_disconnected c.client_source
     | e -> 
-                    lprintf_nl () "Exception %s in client connection to IP %s:%d"
+                    lprintf_nl "Exception %s in client connection to IP %s:%d"
                       (Printexc2.to_string e) (Ip.to_string ip) port;
 (*                    connection_failed c.client_connection_control; *)
                     set_client_disconnected c (Closed_for_exception e);
@@ -2407,7 +2397,7 @@
     let nlocs = List.length t.Q.locs in
     
     if !verbose_location then
-        lprintf_nl () "Received %d sources from server %s:%s for %s"
+        lprintf_nl "Received %d sources from server %s:%s for %s"
      nlocs (Ip.to_string s.server_ip) (string_of_int s.server_port) (file_best_name file);
     
     s.server_score <- s.server_score + 3;
@@ -2456,7 +2446,7 @@
       in
 
       if !verbose_connect || (!verbose && (too_many_indirect_connections || is_connecting_server)) then
-        lprintf_nl () "incoming connection from %s:%d %s: (%d/%d)%s"
+        lprintf_nl "incoming connection from %s:%d %s: (%d/%d)%s"
           s_from_ip from_port
           (if accept_connection then "accepted" else
        if is_ip_blocked then "blocked" else "denied")
@@ -2503,11 +2493,11 @@
                     (DonkeyProtoCom.client_handler2 c (read_first_message overnet)
                     (client_to_client []));
                 
-                with e -> lprintf_nl () "Exception %s in init_connection"
+                with e -> lprintf_nl "Exception %s in init_connection"
                       (Printexc2.to_string e);
                     );
             with e ->
-                lprintf_nl () "Exception %s in client_connection_handler"
+                lprintf_nl "Exception %s in client_connection_handler"
                   (Printexc2.to_string e);
                 Unix.close s)
         end     
@@ -2565,7 +2555,7 @@
             file.file_sources (last_time ()))        
       with e -> 
         if !verbose then
-          lprintf_nl () "query_source: exception %s" (Printexc2.to_string e)
+          lprintf_nl "query_source: exception %s" (Printexc2.to_string e)
         );
   
   DonkeySources.functions.DonkeySources.function_connect <-
@@ -2583,7 +2573,7 @@
                   
       with e -> 
        if !verbose then begin
-         lprintf_nl () "connect_source: exception %s" (Printexc2.to_string e);
+         lprintf_nl "connect_source: exception %s" (Printexc2.to_string e);
        end
   );
   
@@ -2619,7 +2609,7 @@
 	Not_found -> ()
       | e -> 
         if !verbose then
-          lprintf_nl () "add_location: exception %s" (Printexc2.to_string e)
+          lprintf_nl "add_location: exception %s" (Printexc2.to_string e)
   );
   
   DonkeySources.functions.DonkeySources.function_remove_location <- (fun
@@ -2634,6 +2624,6 @@
 	Not_found -> ()
       | e -> 
         if !verbose then
-          lprintf_nl () "remove_location for file_md4 %s: exception %s"
+          lprintf_nl "remove_location for file_md4 %s: exception %s"
       file_uid (Printexc2.to_string e)
   )
Index: src/networks/donkey/donkeyComplexOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyComplexOptions.ml,v
retrieving revision 1.47
diff -u -u -w -r1.47 donkeyComplexOptions.ml
--- src/networks/donkey/donkeyComplexOptions.ml	17 May 2006 08:52:43 -0000	1.47
+++ src/networks/donkey/donkeyComplexOptions.ml	19 May 2006 21:58:28 -0000
@@ -61,10 +61,6 @@
 
 *)
 
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-  (log_time ()); lprintf_nl2
-
 let create_online_sig () =
   
   let most_users = ref Int64.zero in
@@ -250,7 +246,7 @@
         get_value "file_diskname" value_to_string
       with _ ->
         let filename = Filename.concat !!temp_directory file_md4 in
-          lprintf_nl () "getting file_diskname from ini failed, testing for ed2k-temp-file %s" filename;
+          lprintf_nl "getting file_diskname from ini failed, testing for ed2k-temp-file %s" filename;
         if Sys.file_exists filename then
           filename
         else
@@ -260,7 +256,7 @@
                 !!temp_directory
                 ( string_of_uid ( Ed2k (Md4.of_string file_md4) ) )
             in
-            lprintf_nl () "geting file_diskname from ini failed, testing for ed2k-temp-file %s"
+            lprintf_nl "geting file_diskname from ini failed, testing for ed2k-temp-file %s"
               filename;
             if Sys.file_exists filename then
               filename
@@ -272,9 +268,9 @@
     in
     if not (Sys.file_exists filename) then
       (* I think we should die here, to prevent any corruption. *)
-      lprintf_nl () "ERROR ED2K-TEMP-FILE %s DOES NOT EXIST, THIS WILL PERHAPS LEAD TO CORRUPTION IN THAT DOWNLOAD!"
+      lprintf_nl "ERROR ED2K-TEMP-FILE %s DOES NOT EXIST, THIS WILL PERHAPS LEAD TO CORRUPTION IN THAT DOWNLOAD!"
         filename;
-    if !verbose then lprintf_nl () "ed2k-temp-file %s used." filename;
+    if !verbose then lprintf_nl "ed2k-temp-file %s used." filename;
     filename
   in
 
@@ -463,7 +459,7 @@
 let config_files_loaded = ref false  
       
 let load _ =
-  if !verbose then lprintf_nl () "Loading shared files";
+  if !verbose then lprintf_nl "Loading shared files";
   (try
       Options.load shared_files_ini;
       Options.load stats_ini;
@@ -555,7 +551,7 @@
 let check_result r tags =
   if r.result_names = [] || r.result_size = Int64.zero then begin
       if !verbose then begin
-          lprintf_n () "Bad search result: ";
+          lprintf_n "Bad search result: ";
           List.iter (fun tag ->
               lprintf "[%s] = [%s] " (string_of_field tag.tag_name)
                 (string_of_tag_value tag.tag_value)
Index: src/networks/donkey/donkeyFiles.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyFiles.ml,v
retrieving revision 1.19
diff -u -u -w -r1.19 donkeyFiles.ml
--- src/networks/donkey/donkeyFiles.ml	1 Jan 2006 19:36:03 -0000	1.19
+++ src/networks/donkey/donkeyFiles.ml	19 May 2006 21:58:28 -0000
@@ -46,16 +46,6 @@
 open CommonGlobals
 open DonkeyStats
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf
-
 let msg_block_size_int = 10240
 let msg_block_size = Int64.of_int msg_block_size_int
 let upload_buffer = String.create msg_block_size_int
@@ -89,7 +79,7 @@
 (*      let len_int = Int32.to_int len in *)
       try
 	if !verbose_upload then
-	  lprintf_nl () "send_small_block (%s) %Ld %d"
+    lprintf_nl "send_small_block (%s) %Ld %d"
 	    (full_client_identifier c)
             (begin_pos) (len_int);
         
@@ -124,9 +114,9 @@
         write_string sock upload_buffer;
         check_end_upload c sock
       with
-	End_of_file -> lprintf_nl () "Can not send file %s to %s, file removed?"
+  End_of_file -> lprintf_nl "Can not send file %s to %s, file removed?"
 			 (file_best_name file) (full_client_identifier c)
-      | e -> if !verbose then lprintf_nl ()
+      | e -> if !verbose then lprintf_nl
 	       "Exception %s in send_small_block" (Printexc2.to_string e)
     
     let rec send_client_block c sock per_client =
@@ -145,14 +135,14 @@
 (* last block from chunk *)
               begin
                 if !verbose_upload then
-                    lprintf_nl () "END OF CHUNK (%d) %Ld" max_len up.up_end_chunk; 
+                    lprintf_nl "END OF CHUNK (%d) %Ld" max_len up.up_end_chunk; 
                 send_small_block c sock up.up_file up.up_pos max_len;
                 up.up_chunks <- chunks;
                 let per_client = per_client - max_len in
                 match chunks with
                   [] -> 
                     if !verbose_upload then
-                        lprintf_nl () "NO CHUNKS";
+                        lprintf_nl "NO CHUNKS";
                     c.client_upload <- None;
                 | (begin_pos, end_pos) :: _ ->
                     up.up_pos <- begin_pos;
Index: src/networks/donkey/donkeyGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyGlobals.ml,v
retrieving revision 1.79
diff -u -u -w -r1.79 donkeyGlobals.ml
--- src/networks/donkey/donkeyGlobals.ml	9 Apr 2006 00:27:03 -0000	1.79
+++ src/networks/donkey/donkeyGlobals.ml	19 May 2006 21:58:28 -0000
@@ -232,13 +232,6 @@
       List2.tail_map (fun s -> as_server s.server_server) !connected_server_list
   )
 
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-  (log_time ()); lprintf_nl2
-
-let lprintf_n () =
-  lprintf "%s[EDK] "
-  (log_time ()); lprintf
 
 let hashtbl_remove table key v =
   try
@@ -303,13 +296,13 @@
             then
               begin
                 if !verbose_share then
-                  lprintf_nl () "New file with changed filename %s to %s"
+                  lprintf_nl "New file with changed filename %s to %s"
                     file.file_diskname file_diskname;
                 file.file_diskname <- file_diskname;
               end
           else
             if !verbose_share then
-              lprintf_nl () "New file with not changed different filename %s and %s"
+              lprintf_nl "New file with not changed different filename %s and %s"
                 file.file_diskname file_diskname;
         end;
       if Unix32.destroyed (file_fd file)
@@ -319,12 +312,12 @@
           file.file_file.impl_file_fd <-
             Some (Unix32.create_diskfile file.file_diskname true);
       if Unix32.destroyed (file_fd file) then
-          lprintf_nl () "New Edonkey file with %b && %b remaining destroyed fd %s"
+          lprintf_nl "New Edonkey file with %b && %b remaining destroyed fd %s"
             (not writable) (file.file_diskname = file_diskname) file.file_diskname;
       file
   with _ ->
       if !verbose_share then
-        lprintf_nl () "New file with md4: %s" (Md4.to_string md4);
+        lprintf_nl "New file with md4: %s" (Md4.to_string md4);
 
       let t =
         if
@@ -356,7 +349,7 @@
 	    (try
 	      Unix32.remove t
 	     with e ->
-		lprintf_nl () "Unix32.remove %s exception %s"
+    lprintf_nl "Unix32.remove %s exception %s"
 		  (file_diskname) (Printexc2.to_string e));
 	    Unix32.destroy t;
 	    failwith (Printf.sprintf "file size %s is too big, exception: %s"
@@ -463,7 +456,7 @@
         None -> false
       | Some reason ->
           if !verbose_connect then
-            lprintf_nl () "%s:%d blocked: %s" (Ip.to_string ip) port reason;
+            lprintf_nl "%s:%d blocked: %s" (Ip.to_string ip) port reason;
           true))
 
 let new_server ip port score =
@@ -926,7 +919,7 @@
       ) c.client_file_queue in
     begin
       if c.client_debug then
-        lprintf_nl () "Saving %d files associated with %s"
+        lprintf_nl "Saving %d files associated with %s"
         (List.length files) (Md4.to_string c.client_md4);
       Hashtbl.add join_queue_by_md4 c.client_md4 (files, last_time ());
       try
@@ -968,12 +961,12 @@
       if not (try String.sub !!client_private_key 0 4 = "MIIB" with e -> false) then
         if !key_check_again then
 	  begin
-	    lprintf_nl () "can not create proper client_private_key, exiting...";
+      lprintf_nl "can not create proper client_private_key, exiting...";
 	    exit 70
 	  end
 	else
           begin
-            lprintf_nl () "bad client_private_key detected, creating new key";
+            lprintf_nl "bad client_private_key detected, creating new key";
 	    set_simple_option donkey_ini "client_private_key" (DonkeySui.SUI.create_key ());
 	    key_check_again := true
 	  end
@@ -981,7 +974,7 @@
     if not !key_checked then check_client_private_key ();
     if !key_check_again then
       begin
-	lprintf_nl () "re-checking private key";
+  lprintf_nl "re-checking private key";
 	check_client_private_key ()
       end
     );
Index: src/networks/donkey/donkeyInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml,v
retrieving revision 1.105
diff -u -u -w -r1.105 donkeyInteractive.ml
--- src/networks/donkey/donkeyInteractive.ml	17 May 2006 08:52:43 -0000	1.105
+++ src/networks/donkey/donkeyInteractive.ml	19 May 2006 21:58:28 -0000
@@ -55,15 +55,6 @@
 open DonkeyStats
 open DonkeyUdp
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf
 
 let result_name r =
   match r.result_names with
@@ -117,7 +108,7 @@
     ) ss;
     List.length ss
   with e ->
-      lprintf_nl () "Exception %s while loading %s" (Printexc2.to_string e)
+      lprintf_nl "Exception %s while loading %s" (Printexc2.to_string e)
       filename;
       0
   else 0
@@ -133,21 +124,21 @@
 	      Unix2.tryopen_read_zip filename (fun ic ->
 		try
 		  let file = Zip.find_entry ic "server.met" in
-		  lprintf_nl () "server.met found in %s" url;
+      lprintf_nl "server.met found in %s" url;
 		  file.Zip.filename
 		with e ->
-		  lprintf_nl () "Exception %s while extracting server.met from %s"
+      lprintf_nl "Exception %s while extracting server.met from %s"
 		    (Printexc2.to_string e) url;
 		  raise e) in
 	    (try
 	      ignore(Misc.archive_extract filename "zip")
 	    with e ->
-	      lprintf_nl () "Exception %s while extracting server.met from %s"
+        lprintf_nl "Exception %s while extracting server.met from %s"
 		(Printexc2.to_string e) url;
 	      raise e);
 	    result
 	  with e ->
-            lprintf_nl () "Exception %s while opening %s"
+            lprintf_nl "Exception %s while opening %s"
 	      (Printexc2.to_string e) url;
             raise Not_found)
     | ".met.gz" | ".met.bz2" | ".gz" | ".bz2" ->
@@ -156,7 +147,7 @@
 	try
           Misc.archive_extract filename filetype
 	with e ->
-          lprintf_nl () "Exception %s while extracting from %s"
+          lprintf_nl "Exception %s while extracting from %s"
 	    (Printexc2.to_string e) url;
           raise Not_found)
 (* if file is not a supported archive type try loading servers from that file anyway *)
@@ -178,7 +169,7 @@
         let s = unpack_server_met filename url in
     let n = load_server_met s in
       if s <> filename then Sys.remove s;
-            lprintf_nl () "server.met loaded from %s, %d servers found, %d new ones inserted"
+            lprintf_nl "server.met loaded from %s, %d servers found, %d new ones inserted"
         url n ((List.length (Hashtbl2.to_list servers_by_key)) - nservers)
       with e -> ()
     )
@@ -214,15 +205,15 @@
            && not (Sys.file_exists file_diskname)
           then
             (try
-              lprintf_nl () "Renaming edonkey temp-file from %s to %s"
+              lprintf_nl "Renaming edonkey temp-file from %s to %s"
                   filename file_diskname;
               Unix2.rename filename file_diskname;
               Unix2.chmod file_diskname 0o644;
               with e ->
-                lprintf_nl () "Could not rename %s to %s: exception %s"
+                lprintf_nl "Could not rename %s to %s: exception %s"
                   filename file_diskname (Printexc2.to_string e);
             )
-        else lprintf_nl () "THERE IS SOME PROBLEM WITH RECOVERING TEMP-FILES, THAT COULD CAUSE FILE-CORRUPTION!!!!!!!!!!! filename: %s  exists:%b file_diskname: %s  exists:%b"
+        else lprintf_nl "THERE IS SOME PROBLEM WITH RECOVERING TEMP-FILES, THAT COULD CAUSE FILE-CORRUPTION!!!!!!!!!!! filename: %s  exists:%b file_diskname: %s  exists:%b"
                filename (Sys.file_exists filename)
                file_diskname (Sys.file_exists file_diskname);
     | _ -> ()
@@ -249,7 +240,7 @@
             CommonSwarming.set_absent swarmer absents
   end;
 
-  if !verbose then lprintf_nl () "Started new download, file %s, size %Ld, md4 %s"
+  if !verbose then lprintf_nl "Started new download, file %s, size %Ld, md4 %s"
     (file_best_name file) size (Md4.to_string md4);
 
   DonkeyProtoOvernet.Overnet.recover_file file;
@@ -371,7 +362,7 @@
     let t = P.read s in
     t.P.client_tags, t.P.option_tags
   with e ->
-      lprintf_nl () "Exception %s while loading %s" (Printexc2.to_string e)
+      lprintf_nl "Exception %s while loading %s" (Printexc2.to_string e)
       filename;
       [], []
 
@@ -391,7 +382,7 @@
             List.iter (fun tag ->
                 match tag with
                   { tag_name = Field_Filename; tag_value = String s } ->
-                    lprintf_nl () "Import Donkey %s" s;
+                    lprintf_nl "Import Donkey %s" s;
 
                     filenames := s :: !filenames;
                 | { tag_name = Field_Size; tag_value = Uint64 v } ->
@@ -423,7 +414,7 @@
       | { tag_name = Field_UNKNOWN "temp"; tag_value = String s } ->
           if Sys.file_exists s then (* be careful on that *)
             temp_dir := s
-          else (lprintf_nl () "Bad temp directory, using default";
+          else (lprintf_nl "Bad temp directory, using default";
               )
       | _ -> ()
   ) ot;
@@ -1052,7 +1043,7 @@
           } in
         v
       with e ->
-          lprintf_nl () "Exception %s in op_file_info" (Printexc2.to_string e);
+          lprintf_nl "Exception %s in op_file_info" (Printexc2.to_string e);
           raise e
 
   )
@@ -1511,7 +1502,7 @@
               (try
                  try_recover_temp_file filename md4
                with e ->
-                 lprintf_nl () "exception %s in recover_temp"
+                 lprintf_nl "exception %s in recover_temp"
                  (Printexc2.to_string e);
               )
           | NoUid ->
@@ -1520,7 +1511,7 @@
                    let md4 = Md4.of_string filename in
                    try_recover_temp_file filename md4
                  with e ->
-                   lprintf_nl () "exception %s in recover_temp"
+                   lprintf_nl "exception %s in recover_temp"
                      (Printexc2.to_string e);
               )
           | _ -> ()
@@ -1550,7 +1541,7 @@
       | Some files ->
           List2.tail_map (fun r -> "", r) files);
   client_ops.op_client_browse <- (fun c immediate ->
-      lprintf_nl () "*************** should browse  ***********";
+      lprintf_nl "*************** should browse  ***********";
       match c.client_source.DonkeySources.source_sock with
       | Connection sock    ->
 (*
@@ -1564,8 +1555,8 @@
             let module C = M.ViewFiles in
             M.ViewFilesReq C.t);
       | NoConnection ->
-          lprintf_nl () "****************************************";
-          lprintf_nl () "       TRYING TO CONTACT FRIEND";
+          lprintf_nl "****************************************";
+          lprintf_nl "       TRYING TO CONTACT FRIEND";
 
           reconnect_client c
       | _ -> ()
@@ -1711,7 +1702,7 @@
     (fun url filename ->
     if !!enable_donkey && !!update_server_list_server_met then
       begin
-        lprintf_n () "server.met loaded from %s" url;
+        lprintf_n "server.met loaded from %s" url;
   begin
     try
       let s = unpack_server_met filename url in
@@ -1726,14 +1717,14 @@
       end
     else
       if not !!enable_donkey then
-        lprintf_nl () "eDonkey module is disabled, ignoring..."
+        lprintf_nl "eDonkey module is disabled, ignoring..."
       else
-        lprintf_nl () "ED2K_update_server_list_met is disabled, ignoring..."
+        lprintf_nl "ED2K_update_server_list_met is disabled, ignoring..."
   );
   CommonWeb.add_web_kind "comments.met" "List of edonkey files comments" 
     (fun _ filename ->
 (* TODO      DonkeyIndexer.load_comments filename; *)
-      lprintf_nl () "COMMENTS ADDED";
+      lprintf_nl "COMMENTS ADDED";
   );
 
   file_ops.op_file_proposed_filenames <- op_file_proposed_filenames;
Index: src/networks/donkey/donkeyMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyMain.ml,v
retrieving revision 1.48
diff -u -u -w -r1.48 donkeyMain.ml
--- src/networks/donkey/donkeyMain.ml	8 Apr 2006 01:27:29 -0000	1.48
+++ src/networks/donkey/donkeyMain.ml	19 May 2006 21:58:28 -0000
@@ -45,10 +45,6 @@
 open DonkeyThieves
 open DonkeyOptions
 
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
 let _ =
   network.op_network_is_enabled <- (fun _ -> !!enable_donkey);
   option_hook enable_donkey (fun _ ->
@@ -76,7 +72,7 @@
       DonkeySources.connect_sources connection_manager;
     with e ->
         if !verbose_sources > 2 then 
-          lprintf_nl () "Exception %s while checking sources" 
+          lprintf_nl "Exception %s while checking sources" 
             (Printexc2.to_string e)
   );
   DonkeyServers.udp_walker_timer ()
@@ -226,7 +222,7 @@
                   if Unix32.file_exists file_disk_name &&
                     Unix32.getsize file_disk_name <> Int64.zero then begin
                     (* getsize writable=false is ok because file has state FileDownloaded *)
-                      lprintf_nl () "FILE DOWNLOADED"; 
+                      lprintf_nl "FILE DOWNLOADED"; 
                       
                       DonkeyOneFile.declare_completed_file file;
                     end
@@ -235,7 +231,7 @@
                     file_commit (as_file file)
               end
           with e ->
-              lprintf_nl () "Exception %s while recovering download %s"
+              lprintf_nl "Exception %s while recovering download %s"
                 (Printexc2.to_string e) (file_disk_name file); 
       ) files_by_md4;
       
@@ -277,7 +273,7 @@
               udp_sock := Some sock;
               UdpSocket.set_write_controler sock udp_write_controler;
             with e ->
-                lprintf_nl () "Exception %s while binding UDP socket"
+                lprintf_nl "Exception %s while binding UDP socket"
                   (Printexc2.to_string e);
           end;
           sock
@@ -337,13 +333,13 @@
 *)
 
   with e ->
-      lprintf_nl () "Error: Exception %s during startup"
+      lprintf_nl "Error: Exception %s during startup"
         (Printexc2.to_string e)
 
 
 let rec update_options () =
   let update v =
-      lprintf_nl () "Updating options to version %i" v;
+      lprintf_nl "Updating options to version %i" v;
       options_version =:= v;
       update_options ()
   in
Index: src/networks/donkey/donkeyOneFile.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyOneFile.ml,v
retrieving revision 1.36
diff -u -u -w -r1.36 donkeyOneFile.ml
--- src/networks/donkey/donkeyOneFile.ml	9 Apr 2006 00:27:03 -0000	1.36
+++ src/networks/donkey/donkeyOneFile.ml	19 May 2006 21:58:29 -0000
@@ -55,10 +55,6 @@
    Once the block has been finished allow changing order.
 *)
 
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
 let sort_file_queue c =
   match c.client_download with
     Some _ -> ()
@@ -67,12 +63,12 @@
         [] -> ()
       | [ (file, chunks, up) ] ->
           if !verbose_download || c.client_debug then begin
-              lprintf_nl () "sort_file_queue: single file. client(%d): %s, file(%d): %s" (client_num c) c.client_name (file_num file) (file_best_name file);
+              lprintf_nl "sort_file_queue: single file. client(%d): %s, file(%d): %s" (client_num c) c.client_name (file_num file) (file_best_name file);
             end
       | (file, chunks, up) :: _ ->
           let fn = file_num file in
           if !verbose_download || c.client_debug then begin
-              lprintf_nl () "sort_file_queue: multiple files. client(%d): %s, file(%d): %s" (client_num c) c.client_name (file_num file) (file_best_name file);
+              lprintf_nl "sort_file_queue: multiple files. client(%d): %s, file(%d): %s" (client_num c) c.client_name (file_num file) (file_best_name file);
             end;
           c.client_file_queue <- List.stable_sort (fun (f1, _, _) (f2, _, _) ->
               let v = file_priority f2 - file_priority f1 in
@@ -90,7 +86,7 @@
           | (file, chunks, _) :: _ ->
               if (file_num file) <> fn then begin
                   if !verbose_download || c.client_debug then begin
-                      lprintf_nl () "sort_file_queue: queue change. client(%d): %s, file(%d): %s" (client_num c) c.client_name (file_num file) (file_best_name file);
+                      lprintf_nl "sort_file_queue: queue change. client(%d): %s, file(%d): %s" (client_num c) c.client_name (file_num file) (file_best_name file);
                     end;
 (*
 (*                  c.client_chunks <- chunks; *)
@@ -116,7 +112,7 @@
     None -> ()
   | Some s -> 
       if !verbose_share then
-        lprintf_nl () "unshare_file %s" file.file_diskname;
+        lprintf_nl "unshare_file %s" file.file_diskname;
       file.file_shared <- None;
       decr nshared_files;
       CommonShared.shared_calculate_total_bytes ();
@@ -177,14 +173,14 @@
           
           let downloaded = CommonSwarming.downloaded swarmer in
           if file_downloaded file <> downloaded then begin
-              lprintf_nl () "ERROR: file_downloaded file (%Ld) <> downloaded swarmer (%Ld)"
+              lprintf_nl "ERROR: file_downloaded file (%Ld) <> downloaded swarmer (%Ld)"
                 (file_downloaded file) downloaded
             end;
           
           if verified then begin
               if (file_size file <> downloaded)
               then
-                lprintf_nl () "Downloaded size differs after complete verification";
+                lprintf_nl "Downloaded size differs after complete verification";
               download_finished file
             end
             
@@ -394,7 +390,7 @@
 let request_slot c = 
     if c.client_slot = SlotNotAsked then begin
       if !verbose_download then begin
-          lprintf_nl () "start_download";
+          lprintf_nl "start_download";
         end;
       do_if_connected c.client_source.DonkeySources.source_sock (fun sock ->
           sort_file_queue c;
@@ -414,13 +410,13 @@
   match c.client_download with
     None -> 
       if !verbose then
-        lprintf_nl ()"block_received for unknown file (md4 %s) for data from %s"
+        lprintf_nl "block_received for unknown file (md4 %s) for data from %s"
 	  (Md4.to_string md4) (full_client_identifier c)
   | Some (file, up) ->
       
       if file.file_md4 <> md4 then begin
           if !verbose then
-            lprintf_nl () "block_received for wrong file, received: %s, expected: %s, from %s"
+            lprintf_nl "block_received for wrong file, received: %s, expected: %s, from %s"
 	      (Md4.to_string md4)
 	      (Md4.to_string file.file_md4)
 	      (full_client_identifier c)
@@ -472,7 +468,7 @@
           
           if new_downloaded -- old_downloaded < len64 then
               if !verbose_download then begin
-                lprintf_nl () "ALREADY RECEIVED: %Ld < %Ld"
+                lprintf_nl "ALREADY RECEIVED: %Ld < %Ld"
               (new_downloaded -- old_downloaded) len64;          
               end;
           get_from_client c
Index: src/networks/donkey/donkeyOvernet.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyOvernet.ml,v
retrieving revision 1.65
diff -u -u -w -r1.65 donkeyOvernet.ml
--- src/networks/donkey/donkeyOvernet.ml	1 Apr 2006 23:19:21 -0000	1.65
+++ src/networks/donkey/donkeyOvernet.ml	19 May 2006 21:58:29 -0000
@@ -332,14 +332,13 @@
 
     open Proto
 
-    let lprintf_nl () =
-      lprintf "%s[%s] "
-      (log_time ())
-      (if Proto.redirector_section = "DKKO" then "Overnet" else "Kademlia"); lprintf_nl2
-
-    let lprintf_n () =
-      lprintf "[%s] "
-      (if Proto.redirector_section = "DKKO" then "Overnet" else "Kademlia"); lprintf
+    let log_prefix = (if Proto.redirector_section = "DKKO" then "[Overnet]" else "[Kademlia]")
+
+    let lprintf_nl fmt =
+      lprintf_nl2 log_prefix fmt
+
+    let lprintf_n fmt =
+      lprintf2 log_prefix fmt
 
 (********************************************************************
 
@@ -854,7 +853,7 @@
         if p.peer_kind < 4 && p.peer_expire > last_time () && 
            p.peer_last_send <> 0 then begin
             if !verbose_overnet then begin
-            lprintf_nl () "Adding good search peer %s:%d"
+            lprintf_nl "Adding good search peer %s:%d"
               (Ip.to_string p.peer_ip) p.peer_port;
 	    end;
             decr nb;
@@ -942,7 +941,7 @@
   end
 
 let create_search kind md4 =
-  if !verbose_overnet then lprintf_nl () "create_search";
+  if !verbose_overnet then lprintf_nl "create_search";
   let starttime = last_time () + (2 * List.length !overnet_searches) in
   let s = ref {
       search_md4 = md4;
@@ -971,7 +970,7 @@
     end
   ) !overnet_searches;
   List.iter (add_search_peer !s) (get_closest_peers md4 max_search_queries);
-  if !verbose_overnet then lprintf_nl () "create_search done";
+  if !verbose_overnet then lprintf_nl "create_search done";
   overnet_searches := !s :: !overnet_searches;
   !s
 
@@ -995,7 +994,7 @@
   let other_ip = ip_of_udp_packet p in
   let other_port = port_of_udp_packet p in
   if !verbose_overnet then
-    lprintf_nl () "UDP FROM %s:%d type %s"
+    lprintf_nl "UDP FROM %s:%d type %s"
       (Ip.to_string other_ip) other_port
       (message_to_string t);
   (* Emule uses other_ip:other_port, so do we *)
@@ -1013,7 +1012,7 @@
        else
 	 begin
 	   if !verbose_overnet then
-	     lprintf_nl () "Connect: invalid IP %s:%d received from %s:%d"
+       lprintf_nl "Connect: invalid IP %s:%d received from %s:%d"
 	          (Ip.to_string p.peer_ip) p.peer_port (Ip.to_string other_ip) other_port;
 	     failwith "Message not understood"
 	 end
@@ -1039,7 +1038,7 @@
         udp_send sender (OvernetPublicized (Some (my_peer ())))
        else begin
 	      if !verbose_overnet then
-	        lprintf_nl () "Publicize: invalid IP %s:%d received from %s:%d"
+          lprintf_nl "Publicize: invalid IP %s:%d received from %s:%d"
 	          (Ip.to_string p.peer_ip) p.peer_port (Ip.to_string other_ip) other_port;
 	      failwith "Message not understood"
 	    end
@@ -1068,8 +1067,8 @@
   | OvernetUnknown (opcode, s) ->
       if !verbose_unknown_messages then
         begin
-          lprintf_nl () "Unknown message from %s:%d " (Ip.to_string other_ip) other_port;
-          lprintf_nl () "\tCode: %d" opcode; dump s;
+          lprintf_nl "Unknown message from %s:%d " (Ip.to_string other_ip) other_port;
+          lprintf_nl "\tCode: %d" opcode; dump s;
         end
 
   | OvernetSearchFilesResults (md4, results) ->
@@ -1088,9 +1087,9 @@
                           s.search_hits <- s.search_hits + 1;
                           Hashtbl.add s.search_results r_md4 r_tags;
                           if !verbose_overnet then begin
-                              lprintf_nl () "FILE FOUND, TAGS:";
+                              lprintf_nl "FILE FOUND, TAGS:";
                               print_tags r_tags;
-                              lprintf_nl () ""
+                              lprintf_nl ""
                         end;
 
                           DonkeyOneFile.search_found true sss r_md4 r_tags;
@@ -1159,32 +1158,32 @@
 
   | OvernetFirewallConnectionACK(md4) ->   
        if !verbose_overnet && debug_client other_ip then   
-         lprintf_nl () "FIREWALL ACK for md4=%s" (Md4.to_string md4)   
+         lprintf_nl "FIREWALL ACK for md4=%s" (Md4.to_string md4)   
     
    | OvernetFirewallConnectionNACK(md4) ->   
        if !verbose_overnet && debug_client other_ip then   
-         lprintf_nl () "FIREWALL NACK for md4=%s" (Md4.to_string md4)   
+         lprintf_nl "FIREWALL NACK for md4=%s" (Md4.to_string md4)   
     
  (* send the answer *)   
    | OvernetGetMyIP other_port ->   
        if !verbose_overnet && debug_client other_ip then   
-         lprintf_nl () "GET MY IP (port=%d)\n" other_port;   
+         lprintf_nl "GET MY IP (port=%d)\n" other_port;   
  (* FIXME : should be able to flush the UDP buffer*)   
        udp_send sender (OvernetGetMyIPResult other_ip);   
        udp_send sender OvernetGetMyIPDone   
     
    | OvernetGetMyIPResult(ip) ->   
        if !verbose_overnet && debug_client other_ip then   
-         lprintf_nl () "GET MY IP RESULT (%s)\n" (Ip.to_string ip)   
+         lprintf_nl "GET MY IP RESULT (%s)\n" (Ip.to_string ip)   
     
    | OvernetGetMyIPDone ->   
        if !verbose_overnet && debug_client other_ip then   
-         lprintf_nl () "GET MY IP DONE\n"   
+         lprintf_nl "GET MY IP DONE\n"   
   
   | OvernetPeerNotFound peer ->
       begin
         if !verbose_overnet || debug_client other_ip then
-          lprintf_nl () "Peer NOT FOUND %s (%s:%d) kind: %d (msg 33)"
+          lprintf_nl "Peer NOT FOUND %s (%s:%d) kind: %d (msg 33)"
             (Md4.to_string peer.peer_md4) (Ip.to_string peer.peer_ip)
         peer.peer_port peer.peer_kind;
         let dp = { dummy_peer with peer_port = peer.peer_port ; peer_ip = peer.peer_ip } in
@@ -1209,8 +1208,8 @@
 
    | OvernetUnknown21 peer ->
       if !verbose_overnet && debug_client other_ip then begin
-          lprintf_nl () "Unknown 21 message ...";
-          lprintf_nl () "From peer: %s ip: %s:%d kind: %d"
+          lprintf_nl "Unknown 21 message ...";
+          lprintf_nl "From peer: %s ip: %s:%d kind: %d"
             (Md4.to_string peer.peer_md4) (Ip.to_string peer.peer_ip) peer.peer_port peer.peer_kind
         end
 
@@ -1312,7 +1311,7 @@
       begin
         decr connected_peers;
         KnownPeers.remove known_peers p;
-        if !verbose_overnet then lprintf_nl () "update_bucket1: removing %s:%d" (Ip.to_string p.peer_ip) p.peer_port;
+        if !verbose_overnet then lprintf_nl "update_bucket1: removing %s:%d" (Ip.to_string p.peer_ip) p.peer_port;
       end;
     done
 
@@ -1339,7 +1338,7 @@
             end else if p.peer_kind = 4 && p.peer_expire <= last_time () then begin
               decr pre_connected_peers;
               KnownPeers.remove known_peers p;
-              if !verbose_overnet then lprintf_nl () "update_bucket2: removing %s:%d" (Ip.to_string p.peer_ip) p.peer_port;
+              if !verbose_overnet then lprintf_nl "update_bucket2: removing %s:%d" (Ip.to_string p.peer_ip) p.peer_port;
             end else
             (* the rest returns in prebuckets *)
             Fifo.put pb p
@@ -1537,7 +1536,7 @@
     ) ss;
     List.length ss
   with e ->
-      lprintf_nl () "Exception %s while loading %s" (Printexc2.to_string e)
+      lprintf_nl "Exception %s while loading %s" (Printexc2.to_string e)
       filename;
       0
 
@@ -1781,10 +1780,10 @@
             (Ip.of_string ip)
           (int_of_string port)
           (OvernetUnknown (opcode,msg));
-          lprintf_nl () "Sending UDP message %d to %s:%s" opcode ip port;
-          dump msg; lprintf_nl () ""; "Sending UDP message"
+          lprintf_nl "Sending UDP message %d to %s:%s" opcode ip port;
+          dump msg; lprintf_nl ""; "Sending UDP message"
         with _ ->
-            lprintf_nl () "Unable to send UDP message"; "Unable to send UDP message"
+            lprintf_nl "Unable to send UDP message"; "Unable to send UDP message"
     ), ":\t\t\t\tsend UDP message (<ip> <port> <msg in hex>)";
     
     "buckets", Arg_none (fun o ->
@@ -1845,10 +1844,10 @@
 let overnet_search (ss : search) =
   if !!overnet_search_keyword && !!enable_overnet then
     let q = ss.search_query in
-    if !verbose_overnet then lprintf_nl () "========= %s_search =========" command_prefix_to_net;
+    if !verbose_overnet then lprintf_nl "========= %s_search =========" command_prefix_to_net;
     let ws = keywords_of_query q in
     List.iter (fun w ->
-        if !verbose_overnet then lprintf_nl () "%s_search for %s" command_prefix_to_net w;
+        if !verbose_overnet then lprintf_nl "%s_search for %s" command_prefix_to_net w;
         let s = create_keyword_search w ss in
         Hashtbl.iter (fun r_md4 r_tags ->
             DonkeyOneFile.search_found true ss r_md4 r_tags) s.search_results;
@@ -1911,10 +1910,10 @@
                 Ip.async_ip name (fun ip ->
                     let port = int_of_string port in
                     if !verbose_overnet then
-                      lprintf_nl () "Adding %s peer %s:%d" command_prefix_to_net name port;
+                      lprintf_nl "Adding %s peer %s:%d" command_prefix_to_net name port;
                     bootstrap ip port)
-            | _ -> lprintf_nl () "BAD LINE ocl: %s" s;
-          with _ -> lprintf_nl () "DNS failed";
+            | _ -> lprintf_nl "BAD LINE ocl: %s" s;
+          with _ -> lprintf_nl "DNS failed";
       ) lines
   );
 
@@ -1924,12 +1923,12 @@
       (fun url filename ->
         if !!enable_overnet && !!overnet_update_nodes then
           let n = load_contact_dat filename in
-            lprintf_nl () "contact.dat loaded from %s, added %d peers" url n;
+            lprintf_nl "contact.dat loaded from %s, added %d peers" url n;
 	else
 	  if not !!enable_overnet then
-	    lprintf_nl () "Overnet module is disabled, ignoring..."
+      lprintf_nl "Overnet module is disabled, ignoring..."
 	  else
-	    lprintf_nl () "Overnet_update_nodes is disabled, ignoring..."
+      lprintf_nl "Overnet_update_nodes is disabled, ignoring..."
         );
 
 (*************************************************************
Index: src/networks/donkey/donkeyProtoCom.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyProtoCom.ml,v
retrieving revision 1.31
diff -u -u -w -r1.31 donkeyProtoCom.ml
--- src/networks/donkey/donkeyProtoCom.ml	17 Feb 2006 22:25:33 -0000	1.31
+++ src/networks/donkey/donkeyProtoCom.ml	19 May 2006 21:58:29 -0000
@@ -36,14 +36,6 @@
 open DonkeyTypes
 open DonkeyMftp
 
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
-let lprintf_n () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf
-
 let buf = TcpBufferedSocket.internal_buf
 
 let client_msg_to_string emule_version msg =
@@ -64,7 +56,7 @@
   DonkeyProtoServer.write buf msg;
 
   if !verbose_msg_servers then begin
-      lprintf_nl () "MESSAGE TO SERVER:";
+      lprintf_nl "MESSAGE TO SERVER:";
       DonkeyProtoServer.print msg;
       lprint_newline ();
     end;
@@ -87,7 +79,7 @@
 let client_send c m =
   let emule_version = c.client_emule_proto in
   if !verbose_msg_clients || c.client_debug then begin
-      lprintf_nl () "Sent to client[%d] %s(%s) %s" (client_num c)
+      lprintf_nl "Sent to client[%d] %s(%s) %s" (client_num c)
         c.client_name (brand_to_string c.client_brand)
       (match c.client_kind with
           Indirect_address (server_ip, server_port, ip, port, real_ip) ->
@@ -169,7 +161,7 @@
 let really_udp_send t ip port msg isping =
 
   if !verbose_udp then begin
-      lprintf_nl () "Message UDP%s to %s:%d\n%s" 
+      lprintf_nl "Message UDP%s to %s:%d\n%s" 
         (if isping then "(PING)" else "") (Ip.to_string ip) 
         port (DonkeyProtoUdp.print msg);
     end;
@@ -180,7 +172,7 @@
     let s = Buffer.contents buf in
     UdpSocket.write t isping s ip port
   with e ->
-      lprintf_nl () "Exception %s in udp_send" (Printexc2.to_string e)
+      lprintf_nl "Exception %s in udp_send" (Printexc2.to_string e)
 
 let udp_send t ip port msg =
   really_udp_send t ip port msg false
@@ -212,7 +204,7 @@
             if len = 0 ||
               int_of_char pbuf.[0] <> DonkeyOpenProtocol.udp_magic then begin
                 if !verbose_unknown_messages then begin
-                    lprintf_nl () "Received unknown UDP packet";
+                    lprintf_nl "Received unknown UDP packet";
                     dump pbuf;
                   end;
               end else begin
@@ -220,7 +212,7 @@
                 f t p
               end
           with e ->
-              lprintf_nl () "Error %s in udp_basic_handler"
+              lprintf_nl "Error %s in udp_basic_handler"
                 (Printexc2.to_string e)
       ) ;
   | _ -> ()
@@ -239,7 +231,7 @@
       let name = if String2.starts_with name "hidden." then
           String.sub name 7 (String.length name - 7)
         else name in
-      if !verbose_share then lprintf_nl () "tag_file: Sharing %s" name;
+      if !verbose_share then lprintf_nl "tag_file: Sharing %s" name;
       name
     ))::
   (int64_tag Field_Size file.file_file.impl_file_size) ::
@@ -248,7 +240,7 @@
         FormatNotComputed next_time when
         next_time < last_time () ->
           (try
-              if !verbose_share then lprintf_nl () "Find format %s"
+              if !verbose_share then lprintf_nl "Find format %s"
                   (file_disk_name file);
               file.file_format <- (
                 match
@@ -347,7 +339,7 @@
       str_int s 0 nfiles;
       let s = String.sub s 0 prev_len in
       if !verbose_share || !verbose then
-         lprintf_nl () "Sending %d share(s) to server %s:%d%s"
+         lprintf_nl "Sending %d share(s) to server %s:%d%s"
 	   nfiles (Ip.to_string (peer_ip sock)) (peer_port sock)
 	   (if compressed then "(zlib)" else "");
       Buffer.reset buf;
Index: src/networks/donkey/donkeyProtoKademlia.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyProtoKademlia.ml,v
retrieving revision 1.19
diff -u -u -w -r1.19 donkeyProtoKademlia.ml
--- src/networks/donkey/donkeyProtoKademlia.ml	29 Mar 2006 14:22:08 -0000	1.19
+++ src/networks/donkey/donkeyProtoKademlia.ml	19 May 2006 21:58:29 -0000
@@ -35,12 +35,13 @@
 
 module P = struct
 
-    let lprintf_nl () =
-      lprintf "%s[Kademlia] "
-      (log_time ()) ; lprintf_nl2
+    let log_prefix = "[Kademlia]"
 
-    let lprintf_n () =
-      lprintf "[Kademlia] " ; lprintf
+    let lprintf_nl fmt =
+      lprintf_nl2 log_prefix fmt
+
+    let lprintf_n fmt =
+      lprintf2 log_prefix fmt
 
     let names_of_tag =
       [
@@ -261,7 +262,7 @@
                       peer_kind := 3)
               | _ ->
                 if !verbose_unknown_messages then
-                  lprintf_nl () "Unused source tag [%s]"
+                  lprintf_nl "Unused source tag [%s]"
                     (escaped_string_of_field tag)
           ) r_tags;
           {
@@ -403,7 +404,7 @@
           magic <> kademlia_packed_header_code) then
         begin
           if !CommonOptions.verbose_unknown_messages then begin
-              lprintf_nl () "Received unknown UDP packet";
+              lprintf_nl "Received unknown UDP packet";
               dump pbuf;
             end;
           raise Not_found
@@ -440,7 +441,7 @@
 
         if !verbose_overnet then
           begin
-            lprintf_nl () "Sending UDP to %s:%d (opcode 0x%02X len %d) type %s"
+            lprintf_nl "Sending UDP to %s:%d (opcode 0x%02X len %d) type %s"
               (Ip.to_string ip) port (get_uint8 s 1) (String.length s) (message_to_string msg);
           end;
         (*
@@ -454,7 +455,7 @@
         UdpSocket.write sock ping s ip port
       with
       | MessageNotImplemented -> ()
-      | e -> lprintf_nl () "Exception %s in udp_send" (Printexc2.to_string e)
+      | e -> lprintf_nl "Exception %s in udp_send" (Printexc2.to_string e)
 
     let udp_handler f sock event =
       match event with
@@ -474,7 +475,7 @@
               with e ->
                 if !verbose_unknown_messages then
                 begin
-                  lprintf_nl () "Error %s in udp_handler, dump of packet:"
+                  lprintf_nl "Error %s in udp_handler, dump of packet:"
                     (Printexc2.to_string e);
                   dump p.UdpSocket.udp_content;
                   lprint_newline ()
Index: src/networks/donkey/donkeyProtoOvernet.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyProtoOvernet.ml,v
retrieving revision 1.29
diff -u -u -w -r1.29 donkeyProtoOvernet.ml
--- src/networks/donkey/donkeyProtoOvernet.ml	5 May 2006 22:00:16 -0000	1.29
+++ src/networks/donkey/donkeyProtoOvernet.ml	19 May 2006 21:58:29 -0000
@@ -32,12 +32,13 @@
 
 module Proto = struct
 
-     let lprintf_nl () =
-      lprintf "%s[Overnet] "
-      (log_time ()) ; lprintf_nl2
+    let log_prefix = "[Overnet]"
 
-    let lprintf_n () =
-      lprintf "[Overnet] " ; lprintf
+    let lprintf_nl fmt =
+      lprintf_nl2 log_prefix fmt
+
+    let lprintf_n fmt =
+      lprintf2 log_prefix fmt
 
    let names_of_tag = file_common_tags
 
@@ -189,14 +190,14 @@
             Field_UNKNOWN "loc" ->
               for_string_tag tag (fun bcp ->
                   if !verbose_overnet then
-                  lprintf_nl () "loc tag : [%s]" bcp;
+                  lprintf_nl "loc tag : [%s]" bcp;
                   if String2.starts_with bcp "bcp://" then
                     let bcp2 = String.sub bcp 6 (String.length bcp - 6)
                     in
                     match String2.split_simplify bcp2 ':' with
                     | [_;ip;port] ->
                         if !verbose_overnet then
-                          lprintf_nl () "Received BCP type 2 %s"
+                          lprintf_nl "Received BCP type 2 %s"
                             bcp;
 
 (* FIXME: A firewalled peer...
@@ -209,14 +210,14 @@
                         peer_tcpport := int_of_string port;
                     | _ ->
         		if !verbose_overnet then
-                          lprintf_nl () "Ill formed bcp: [%s]" bcp;
+                          lprintf_nl "Ill formed bcp: [%s]" bcp;
                   else
 		    if !verbose_overnet then
-                      lprintf_nl () "Ill formed bcp: [%s]" bcp;
+                      lprintf_nl "Ill formed bcp: [%s]" bcp;
               )
           | _ ->
             if !verbose_unknown_messages then
-              lprintf_nl () "Unused source tag [%s]"
+              lprintf_nl "Unused source tag [%s]"
                 (escaped_string_of_field tag)
       ) r_tags;
       {
@@ -317,7 +318,7 @@
         | 21 ->
 (* idem as 33, but IP seem to be a low ID *)
             if !verbose_overnet then begin
-                lprintf_nl () "Received code %d message. Dump:" opcode;
+                lprintf_nl "Received code %d message. Dump:" opcode;
                 dump s;
                 lprint_newline ();
               end;
@@ -325,42 +326,42 @@
             OvernetUnknown21 peer
         | 24 ->
             if !verbose_overnet then
-              lprintf_nl () "RCVD: OVERNET FIREWALL CONNECTION (24)";
+              lprintf_nl "RCVD: OVERNET FIREWALL CONNECTION (24)";
             let md4 = get_md4 s 0 in
             let port = get_int16 s 16 in
             OvernetFirewallConnection(md4,port)
         | 25 ->
             if !verbose_overnet then
-              lprintf_nl () "RCVD: OVERNET FIREWALL CONNECTION ACK (25)";
+              lprintf_nl "RCVD: OVERNET FIREWALL CONNECTION ACK (25)";
             let md4 = get_md4 s 0 in
             OvernetFirewallConnectionACK(md4)
         | 26 ->
             if !verbose_overnet then
-              lprintf_nl () "RCVD: OVERNET FIREWALL CONNECTION NACK (26)";
+              lprintf_nl "RCVD: OVERNET FIREWALL CONNECTION NACK (26)";
             let md4 = get_md4 s 0 in
             OvernetFirewallConnectionNACK(md4)
         | 27 ->
             if !verbose_overnet then
-              lprintf_nl () "RCVD: GETMYIP MESSAGE (27)";
+              lprintf_nl "RCVD: GETMYIP MESSAGE (27)";
             OvernetGetMyIP (get_int16 s 0)
         | 28 ->
             if !verbose_overnet then
-              lprintf_nl () "RCVD: GETMYIPRESULT MESSAGE (28)";
+              lprintf_nl "RCVD: GETMYIPRESULT MESSAGE (28)";
             let ip = get_ip s 0 in
             OvernetGetMyIPResult (ip)
         | 29 ->
             if !verbose_overnet then
-              lprintf_nl () "RCVD: GETMYIPDONE MESSAGE (29)";
+              lprintf_nl "RCVD: GETMYIPDONE MESSAGE (29)";
             OvernetGetMyIPDone
         | 33 ->
             if !verbose_overnet then
-              lprintf_nl () "RCVD: PEER NOT FOUND (33)";
+              lprintf_nl "RCVD: PEER NOT FOUND (33)";
             let peer, _ = get_peer s 0 in
             OvernetPeerNotFound peer
         | _ ->
             if !verbose_unknown_messages then
               begin
-                lprintf_nl () "unknown opcode %d" opcode;
+                lprintf_nl "unknown opcode %d" opcode;
                 dump s;
                 lprint_newline ();
               end;
@@ -368,7 +369,7 @@
       with e ->
           if !verbose_unknown_messages then
             begin
-              lprintf_nl () "Error %s while parsing opcode %d" (Printexc2.to_string e) opcode;
+              lprintf_nl "Error %s while parsing opcode %d" (Printexc2.to_string e) opcode;
               dump s;
               lprint_newline ();
             end;
@@ -385,7 +386,7 @@
                   int_of_char pbuf.[0] <> 227 then
                   begin
                     if !verbose_unknown_messages then begin
-                        lprintf_nl () "Received unknown UDP packet";
+                        lprintf_nl "Received unknown UDP packet";
                         dump pbuf;
                       end
                   end
@@ -403,7 +404,7 @@
                   end
               with e ->
                 if !verbose_unknown_messages then begin
-                  lprintf_nl () "Error %s in udp_handler, dump of packet:"
+                  lprintf_nl "Error %s in udp_handler, dump of packet:"
                     (Printexc2.to_string e);
                   dump p.UdpSocket.udp_content;
                   lprint_newline ()
@@ -429,12 +430,12 @@
         let s = Buffer.contents udp_buf in
         if !verbose_overnet then
           begin
-            lprintf_nl () "Sending UDP to %s:%d (opcode 0x%02X len %d) type %s"
+            lprintf_nl "Sending UDP to %s:%d (opcode 0x%02X len %d) type %s"
               (Ip.to_string ip) port (get_uint8 s 1) (String.length s) (message_to_string msg);
           end;
         UdpSocket.write sock ping s ip port
       with e ->
-          lprintf_nl () "Exception %s in udp_send" (Printexc2.to_string e)
+          lprintf_nl "Exception %s in udp_send" (Printexc2.to_string e)
 
     let udp_send sock ip port ping msg =
       match msg with
Index: src/networks/donkey/donkeyServers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyServers.ml,v
retrieving revision 1.54
diff -u -u -w -r1.54 donkeyServers.ml
--- src/networks/donkey/donkeyServers.ml	29 Mar 2006 15:41:33 -0000	1.54
+++ src/networks/donkey/donkeyServers.ml	19 May 2006 21:58:30 -0000
@@ -47,16 +47,6 @@
 
 module Udp = DonkeyProtoUdp
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf
-
 (* Constants *)
 let udp_requests_new  = 5
 let udp_requests_old  = 3
@@ -133,7 +123,7 @@
               List.iter (
                 fun file ->
                   if !verbose_location then
-                    lprintf_nl () "TCP: Query Location of %s [%s] [%Ld] [%s]"
+                    lprintf_nl "TCP: Query Location of %s [%s] [%Ld] [%s]"
                       (file_best_name file) (Md4.to_string file.file_md4) (file_size file) (Ip.to_string (peer_ip sock));
                   let module M = DonkeyProtoServer in
                   let module E = M.QueryLocation in
@@ -188,7 +178,7 @@
     ()
   done;
   if !verbose_location then
-    lprintf_nl () "udp_query_source to: %2d old %2d new servers"
+    lprintf_nl "udp_query_source to: %2d old %2d new servers"
       (List.length !old_servers) (List.length !new_servers);
 
   try
@@ -216,7 +206,7 @@
     ) !old_servers;
 
   with e ->
-    lprintf_nl () "udp_query_sources: %s" (Printexc2.to_string e)
+    lprintf_nl "udp_query_sources: %s" (Printexc2.to_string e)
 
 
 let disconnect_server s reason =
@@ -262,7 +252,7 @@
   s.server_last_message <- last_time ();
 
   if !verbose_msg_servers then begin
-    lprintf_nl () "Message from server:";
+    lprintf_nl "Message from server:";
     DonkeyProtoServer.print t; lprint_newline ()
   end;
 
@@ -306,25 +296,25 @@
               s.server_name (Ip.to_string s.server_ip) s.server_port in
           CommonEvent.add_event (Console_message_event (Printf.sprintf "%s\n" server_header));
           if !CommonOptions.verbose_msg_servers then
-      lprintf_nl () "%s" server_header;
+      lprintf_nl "%s" server_header;
           last_message_sender := server_num s
         end;
       s.server_banner <- s.server_banner ^ Printf.sprintf "%s\n" msg;
       let msg = Printf.sprintf "| %s" msg in
       CommonEvent.add_event (Console_message_event (Printf.sprintf "%s\n" msg));
       if !CommonOptions.verbose_msg_servers then
-        lprintf_nl () "%s" msg
+        lprintf_nl "%s" msg
 
   | M.ServerListReq l ->
       if !!update_server_list_server then begin
-        if !verbose_msg_servers then lprintf_nl () "Received serverlist from server";
+        if !verbose_msg_servers then lprintf_nl "Received serverlist from server";
         let module Q = M.ServerList in
         List.iter (fun s ->
             safe_add_server s.Q.ip s.Q.port
         ) l
         end
       else begin
-        if !verbose_msg_servers then lprintf_nl () "Ignored serverlist from server"
+        if !verbose_msg_servers then lprintf_nl "Ignored serverlist from server"
         end
 
 
@@ -359,7 +349,7 @@
       s.server_nfiles <- Int64.of_int files;
       if (users < !!min_users_on_server && not s.server_preferred) then
         begin
-          lprintf_nl () "%s:%d remove server min_users_on_server limit hit!"
+          lprintf_nl "%s:%d remove server min_users_on_server limit hit!"
             (Ip.to_string s.server_ip) s.server_port;
 
           disconnect_server s Closed_for_timeout;
@@ -371,7 +361,7 @@
       (* This can either be a reply to a QueryID or a indirect request for
          connection from another client. In this case, we should immediatly
          connect. *)
-      if !verbose then lprintf_nl () "QueryIDReplyReq: received";
+      if !verbose then lprintf_nl "QueryIDReplyReq: received";
       let module Q = M.QueryIDReply in
       if Ip.usable t.Q.ip then begin
         try
@@ -379,14 +369,14 @@
               None -> raise Not_found
             | Some file ->
                 if !verbose then
-                  lprintf_nl () "QueryIDReplyReq: This was a QueryID reply !?";
+                  lprintf_nl "QueryIDReplyReq: This was a QueryID reply !?";
                 let s = DonkeySources.find_source_by_uid
                   (Direct_address (t.Q.ip, t.Q.port)) in
                 DonkeySources.set_request_result s file.file_sources
                   File_new_source
         with _ ->
           if !verbose then
-            lprintf_nl () "QueryIDReplyReq: Calling back to %s:%d"
+            lprintf_nl "QueryIDReplyReq: Calling back to %s:%d"
               (Ip.to_string t.Q.ip) t.Q.port;
           let c = new_client (Direct_address (t.Q.ip, t.Q.port)) in
           DonkeyClient.reconnect_client c;
@@ -394,7 +384,7 @@
 
   | M.QueryIDFailedReq t ->
       if !verbose then
-        lprintf_nl () "QueryIDFailedReq:";
+        lprintf_nl "QueryIDFailedReq:";
       ignore (Fifo.take s.server_id_requests)
 
   | M.QueryReplyReq t ->
@@ -540,11 +530,11 @@
             if !servers_list = [] then begin
               if !print_empty_list then begin
                 print_empty_list := false;
-                lprintf_nl () "There are no ED2K-servers in your servers.ini.";
-                lprintf_nl () "Please import servers from a server.met file.";
-                lprintf_nl () "Let MLDonkey use a file configured in web_infos";
-                lprintf_nl () "or enter this link into MLDonkey:";
-    lprintf_nl () "ed2k://|serverlist|http://www.jd2k.com/server.met|/"
+                lprintf_nl "There are no ED2K-servers in your servers.ini.";
+                lprintf_nl "Please import servers from a server.met file.";
+                lprintf_nl "Let MLDonkey use a file configured in web_infos";
+                lprintf_nl "or enter this link into MLDonkey:";
+    lprintf_nl "ed2k://|serverlist|http://www.jd2k.com/server.met|/"
               end;
 
               raise Not_found;
@@ -600,7 +590,7 @@
   if last_time () - start_time > !!max_server_age * Date.day_in_secs then begin
   
   if !verbose then
-    lprintf_nl () "old servers: Start check, remove servers not connected for %d days"
+    lprintf_nl "old servers: Start check, remove servers not connected for %d days"
       !!max_server_age;
 (*
 The new tactic: we sort the servers (the more recently connected first,
@@ -629,7 +619,7 @@
 
     if !verbose then
       Array.iteri (fun i (ls, s) ->
-        lprintf_nl () "old servers: server %d last_conn %d" (server_num s) ls) array;
+        lprintf_nl "old servers: server %d last_conn %d" (server_num s) ls) array;
 
     let min_last_conn =  last_time () - !!max_server_age * Date.day_in_secs in
 
@@ -638,7 +628,7 @@
         if ls < min_last_conn && s.server_sock = NoConnection
           && not s.server_preferred then begin
           if !verbose then
-            lprintf_nl () "old servers: Server too old: %s:%d"
+            lprintf_nl "old servers: Server too old: %s:%d"
               (Ip.to_string s.server_ip) s.server_port;
 
           to_remove := s :: !to_remove
@@ -651,7 +641,7 @@
   ) !to_remove;
 
   if !to_remove <> [] || !verbose then
-    lprintf_nl () "Removed %d old edonkey servers." (List.length !to_remove)
+    lprintf_nl "Removed %d old edonkey servers." (List.length !to_remove)
 
   end
 
@@ -694,7 +684,7 @@
                   if connection_can_try s.server_connection_control then
                     begin
                       if !verbose then
-                        lprintf_nl () "WALKER: try connect %s"
+                        lprintf_nl "WALKER: try connect %s"
                           (Ip.to_string s.server_ip);
                       connect_server s
                     end
@@ -702,7 +692,7 @@
                     begin
                       delayed_list := s :: !delayed_list;
                       if !verbose then
-                        lprintf_nl () "WALKER: connect %s delayed"
+                        lprintf_nl "WALKER: connect %s delayed"
                           (Ip.to_string s.server_ip);
                     end
               | _ -> ()
@@ -756,7 +746,7 @@
 (* check connected servers *)
 let update_master_servers _ =
   if !verbose_location then
-    lprintf_nl () "master servers: start re-computing";
+    lprintf_nl "master servers: start re-computing";
   let server_list = List.sort compare_servers (connected_servers ()) in
   let masters = ref [] in
   let tag1 = ref true in
@@ -768,7 +758,7 @@
         | Connection _ ->
             if !verbose_location then begin
         if !tag2 then begin
-                lprintf_n () "master servers (old):";
+                lprintf_n "master servers (old):";
     tag1 := false;
     tag2 := false
         end;
@@ -804,7 +794,7 @@
     if !nconnected_servers > max_allowed_connected_servers then
       begin
         if !verbose_location then
-            lprintf_nl () "master servers: disconnect %s" (Ip.to_string s.server_ip);
+            lprintf_nl "master servers: disconnect %s" (Ip.to_string s.server_ip);
         nconnected_servers := !nconnected_servers - 3;
         do_if_connected  s.server_sock (fun sock ->
             (* We will disconnect from this server.
@@ -823,7 +813,7 @@
             - connection_last_conn s.server_connection_control
           in
           if !verbose_location then
-              lprintf_nl () "master servers: Checking ip:%s, users: %Ld, ct:%d"
+              lprintf_nl "master servers: Checking ip:%s, users: %Ld, ct:%d"
           (Ip.to_string s.server_ip) s.server_nusers connection_time;
           if not s.server_master
             && (s.server_preferred
@@ -835,7 +825,7 @@
                 if (!nmasters < max_allowed_connected_servers) then
                   begin
                     if !verbose_location then
-                        lprintf_nl () "master servers: raising  %s"
+                        lprintf_nl "master servers: raising  %s"
                                   (Ip.to_string s.server_ip);
                     make_master s
                   end
@@ -854,7 +844,7 @@
                           then
                             begin
                               if !verbose_location then
-                                lprintf_nl ()
+                                lprintf_nl
                                   "master servers: raising %s, disconnected %s"
                                   (Ip.to_string s.server_ip) (Ip.to_string ss.server_ip);
                               ss.server_master <- false;
@@ -868,7 +858,7 @@
         )
     ) server_list;
   if !verbose_location then
-      lprintf_nl () "master servers: %d connected %d masters - re-computing completed"
+      lprintf_nl "master servers: %d connected %d masters - re-computing completed"
         !nconnected_servers !nmasters
 
 
Index: src/networks/donkey/donkeyShare.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyShare.ml,v
retrieving revision 1.42
diff -u -u -w -r1.42 donkeyShare.ml
--- src/networks/donkey/donkeyShare.ml	12 May 2006 21:08:30 -0000	1.42
+++ src/networks/donkey/donkeyShare.ml	19 May 2006 21:58:30 -0000
@@ -37,10 +37,6 @@
 open DonkeyComplexOptions
 open DonkeyGlobals
 
-let lprintf_nl () =
-  lprintf "%s[EDK] "
-    (log_time ()); lprintf_nl2
-
 let new_shared_files = ref []
 
 let must_share_file file codedname has_old_impl =
@@ -98,7 +94,7 @@
     in
 
     if !verbose_share then
-      lprintf_nl () "Sharing file with MD4: %s" (Md4.to_string md4);
+      lprintf_nl "Sharing file with MD4: %s" (Md4.to_string md4);
 
     let file = new_file sh.sh_name FileShared md4 sh.sh_size
         [Filename.basename sh.sh_name, GuiTypes.noips()]
@@ -137,9 +133,9 @@
 		 CommonSwarming.verify_all_blocks s true;
 		 *)
                 if !verbose_share then
-                  lprintf_nl () "verified map of %s = %s"
+                  lprintf_nl "verified map of %s = %s"
 		         (codedname) (CommonSwarming.verified_bitmap s))
-      | None -> if !verbose_share then lprintf_nl () "no swarmer for %s" codedname;
+      | None -> if !verbose_share then lprintf_nl "no swarmer for %s" codedname;
     (try
         file.file_format <- CommonMultimedia.get_info
           (file_disk_name file)
@@ -152,9 +148,9 @@
 lprint_newline ());
   *)
     if !verbose_share then
-      lprintf_nl () "new_file_to_share: Sharing %s" sh.sh_name;
+      lprintf_nl "new_file_to_share: Sharing %s" sh.sh_name;
   with e ->
-      lprintf_nl () "Exception %s while sharing %s" (Printexc2.to_string e)
+      lprintf_nl "Exception %s while sharing %s" (Printexc2.to_string e)
       sh.sh_name
 
 let all_shared () =
@@ -164,7 +160,7 @@
         None -> ()
       | Some _ ->  shared_files := file :: !shared_files
   ) files_by_md4;
-  if !verbose_share then lprintf_nl () "%d files shared" (List.length !shared_files);
+  if !verbose_share then lprintf_nl "%d files shared" (List.length !shared_files);
   !shared_files
 
 (* Check whether new files are shared, and send them to connected servers.
@@ -184,19 +180,19 @@
             if s.server_master then
               begin
                 if !verbose_share || !verbose then
-                  lprintf_nl () "send_new_shared: found master server %s:%d"
+                  lprintf_nl "send_new_shared: found master server %s:%d"
 		    (Ip.to_string s.server_ip) s.server_port;
 		tag := true;
                 do_if_connected s.server_sock (fun sock ->
                   server_send_share s.server_has_zlib sock !new_shared_files)
               end) (connected_servers ());
           if !tag && (!verbose_share || !verbose) then
-              lprintf_nl () "send_new_shared: Sent %d new shared files to servers"
+              lprintf_nl "send_new_shared: Sent %d new shared files to servers"
                     (List.length !new_shared_files);
           new_shared_files := []
         end
       else
-          lprintf_nl () "donkey send_new_share: No new shared files to send to servers"
+          lprintf_nl "donkey send_new_share: No new shared files to send to servers"
     end
 
 (*
@@ -228,7 +224,7 @@
               else end_pos in
             let len = end_pos -- sh.shared_pos in
             if !verbose_md4 then
-	      lprintf_nl () "Hash chunk %Ld/%Ld of %s"
+        lprintf_nl "Hash chunk %Ld/%Ld of %s"
 	        ((Int64.div sh.shared_pos block_size) ++ one)
 		((Int64.div sh.shared_size block_size) ++ one)
 		sh.shared_name;
@@ -237,7 +233,7 @@
               (fun job ->
                 computation := false;
                 if job.M.job_error then begin
-                    lprintf_nl () "Error prevent sharing %s" sh.shared_name
+                    lprintf_nl "Error prevent sharing %s" sh.shared_name
                   end else
                 let _ = () in
                 let new_md4 = job.M.job_result in
@@ -251,7 +247,7 @@
                         sh_md4s = Array.of_list (List.rev sh.shared_list);
                         sh_mtime = Unix32.mtime sh.shared_name;
                       } in
-                    lprintf_nl () "New shared file %s" sh.shared_name;
+                    lprintf_nl "New shared file %s" sh.shared_name;
                     Hashtbl.add shared_files_info
                       (s.sh_name, s.sh_size, s.sh_mtime) s;
                     known_shared_files =:= s :: !!known_shared_files;
@@ -262,7 +258,7 @@
                   job_creater ())
           with e ->
 	      shared_files := files;
-              lprintf_nl () "Exception %s prevents sharing of %s"
+              lprintf_nl "Exception %s prevents sharing of %s"
                 (Printexc2.to_string e) sh.shared_name
         in
         job_creater ()
@@ -270,7 +266,7 @@
 let _ =
   network.op_network_share <- (fun fullname codedname size ->
       if !verbose_share then
-        lprintf_nl () "op_network_share: Sharing %s" fullname;
+        lprintf_nl "op_network_share: Sharing %s" fullname;
       try
 (*
 lprintf "Searching %s" fullname; lprint_newline ();
@@ -281,7 +277,7 @@
             (fullname, size, mtime) in
         (* if s.sh_mtime = mtime && s.sh_size = size then begin *)
             if !verbose_share then
-                lprintf_nl () "donkeyShare: Using old MD4s for %s" fullname;
+                lprintf_nl "donkeyShare: Using old MD4s for %s" fullname;
             new_file_to_share s codedname None
 (*          end else begin
             if !verbose_share then begin
@@ -293,7 +289,7 @@
           end *)
       with Not_found ->
           if !verbose_share then
-              lprintf_nl () "donkeyShare: No info on %s" fullname;
+              lprintf_nl "donkeyShare: No info on %s" fullname;
 
 	  let found = ref false in
 	  List.iter (fun sh -> if sh.shared_name = fullname then found := true) !shared_files;
@@ -343,13 +339,13 @@
           Unix32.mtime disk_name
         with _ ->
             if !verbose then
-              lprintf_nl () "Share: Trying mtime on new name %s, disk_name %s, TODO: too many files in shared_files_new.ini?"
+              lprintf_nl "Share: Trying mtime on new name %s, disk_name %s, TODO: too many files in shared_files_new.ini?"
 	        new_name (file_disk_name file);
             Unix32.mtime new_name
       in
 
       if !verbose_share then
-          lprintf_nl () "Remember %s" new_name;
+          lprintf_nl "Remember %s" new_name;
 
       let size = file_size file in
       if not (Hashtbl.mem shared_files_info
@@ -364,7 +360,7 @@
         known_shared_files =:= s :: !!known_shared_files;
         Hashtbl.add shared_files_info (new_name, size, mtime) s
     with e ->
-        lprintf_nl () "Exception %s in remember_shared_info"
+        lprintf_nl "Exception %s in remember_shared_info"
           (Printexc2.to_string e)
 
 let must_share_file file = must_share_file file (file_best_name file) None
Index: src/networks/donkey/donkeyThieves.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyThieves.ml,v
retrieving revision 1.7
diff -u -u -w -r1.7 donkeyThieves.ml
--- src/networks/donkey/donkeyThieves.ml	18 Dec 2005 14:50:38 -0000	1.7
+++ src/networks/donkey/donkeyThieves.ml	19 May 2006 21:58:30 -0000
@@ -34,6 +34,12 @@
 open DonkeyTypes
 open DonkeyGlobals
 
+
+let log_prefix = "[eDThieves]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
 type hash_history = Ip.t * Md4.t * int
 
 (* index by client IP *)
@@ -101,7 +107,7 @@
 	    (* it switched to a hash that's used somewhere else,
 	       that's certainly a theft. *)
 	    if !verbose then
-	      lprintf_nl () "client_md4 %s (ip:%s) was already used somewhere else, that's certainly a theft!"
+        lprintf_nl "client_md4 %s (ip:%s) was already used somewhere else, that's certainly a theft!"
 	        (Md4.to_string hash) (Ip.to_string ip);
 	    false
 ;;
Index: src/networks/donkey/donkeyTypes.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyTypes.ml,v
retrieving revision 1.39
diff -u -u -w -r1.39 donkeyTypes.ml
--- src/networks/donkey/donkeyTypes.ml	9 Apr 2006 00:27:03 -0000	1.39
+++ src/networks/donkey/donkeyTypes.ml	19 May 2006 21:58:30 -0000
@@ -22,6 +22,16 @@
 open CommonDownloads
 open CommonTypes
 open CommonStats
+open Printf2
+
+let log_prefix = "[EDK]"
+    
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+    
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
+
   (*
 
 module MyList = struct
Index: src/networks/fasttrack/fasttrackGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fasttrack/fasttrackGlobals.ml,v
retrieving revision 1.37
diff -u -u -w -r1.37 fasttrackGlobals.ml
--- src/networks/fasttrack/fasttrackGlobals.ml	17 May 2006 08:52:43 -0000	1.37
+++ src/networks/fasttrack/fasttrackGlobals.ml	19 May 2006 21:58:30 -0000
@@ -44,15 +44,13 @@
 open FasttrackTypes
 open FasttrackOptions
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[Fasttrack] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[Fasttrack] "
-    (log_time ()); lprintf
+let log_prefix = "[Fasttrack]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let search_num = ref 0
 
Index: src/networks/fasttrack/fasttrackServers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fasttrack/fasttrackServers.ml,v
retrieving revision 1.28
diff -u -u -w -r1.28 fasttrackServers.ml
--- src/networks/fasttrack/fasttrackServers.ml	9 May 2006 08:40:25 -0000	1.28
+++ src/networks/fasttrack/fasttrackServers.ml	19 May 2006 21:58:31 -0000
@@ -60,7 +60,7 @@
               ignore (H.new_host ip port Ultrapeer)
             with Not_found -> ()
         with _ ->
-          lprintf_nl () "Syntax error in %s" filename;
+          lprintf_nl "Syntax error in %s" filename;
       done
     
     with End_of_file -> ()
@@ -75,7 +75,7 @@
          try     
             Misc.archive_extract filename "gz"
          with e ->
-          lprintf_nl () "Exception %s while extracting from %s" (Printexc2.to_string e) url;
+          lprintf_nl "Exception %s while extracting from %s" (Printexc2.to_string e) url;
           raise Not_found
       )
     | _ -> filename
@@ -83,7 +83,7 @@
 let _ =
     CommonWeb.add_web_kind "nodes.gzip" "List of fasttrack nodes"
     (fun url filename -> 
-        lprintf_nl () "nodes.gzip loaded from %s" url;
+        lprintf_nl "nodes.gzip loaded from %s" url;
         try
           let f = unpack_nodes_gzip filename url in
           load_nodes_file f;
Index: src/networks/fileTP/fileTPClients.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fileTP/fileTPClients.ml,v
retrieving revision 1.18
diff -u -u -w -r1.18 fileTPClients.ml
--- src/networks/fileTP/fileTPClients.ml	9 Apr 2006 00:27:04 -0000	1.18
+++ src/networks/fileTP/fileTPClients.ml	19 May 2006 21:58:31 -0000
@@ -63,7 +63,7 @@
   | Connection sock ->
       (try
           if !verbose_msg_clients then
-              lprintf_nl () "Disconnected from source";
+              lprintf_nl "Disconnected from source";
           c.client_requests <- [];
           connection_failed c.client_connection_control;
           set_client_disconnected c r;
Index: src/networks/fileTP/fileTPGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fileTP/fileTPGlobals.ml,v
retrieving revision 1.23
diff -u -u -w -r1.23 fileTPGlobals.ml
--- src/networks/fileTP/fileTPGlobals.ml	9 May 2006 17:04:58 -0000	1.23
+++ src/networks/fileTP/fileTPGlobals.ml	19 May 2006 21:58:31 -0000
@@ -41,15 +41,13 @@
 open FileTPTypes
 open FileTPOptions
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[FileTP] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[FileTP] "
-    (log_time ()); lprintf
+let log_prefix = "[FileTP]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let network = new_network "FTP" "FileTP"
     [ ]
Index: src/networks/fileTP/fileTPHTTP.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fileTP/fileTPHTTP.ml,v
retrieving revision 1.22
diff -u -u -w -r1.22 fileTPHTTP.ml
--- src/networks/fileTP/fileTPHTTP.ml	5 May 2006 22:08:00 -0000	1.22
+++ src/networks/fileTP/fileTPHTTP.ml	19 May 2006 21:58:31 -0000
@@ -46,15 +46,13 @@
 
 open FileTPClients
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[FileTP] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[FileTP] "
-    (log_time ()); lprintf
+let log_prefix = "[FileTP]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 (*************************************************************************)
 (*                                                                       *)
@@ -89,7 +87,7 @@
   Printf.bprintf buf "\r\n";
   let s = Buffer.contents buf in
   if !verbose_msg_clients then
-    lprintf_nl () "SENDING REQUEST to %s: %s"
+    lprintf_nl "SENDING REQUEST to %s: %s"
       c.client_hostname
       (String.escaped s);
   write_string sock s;
@@ -103,7 +101,7 @@
 
 let rec client_parse_header c gconn sock header =
   if !verbose_msg_clients then
-    lprintf_nl () "CLIENT PARSE HEADER";
+    lprintf_nl "CLIENT PARSE HEADER";
   try
     set_lifetime sock 3600.;
     let d =
@@ -116,7 +114,7 @@
     connection_ok c.client_connection_control;
     set_client_state c Connected_initiating;
     if !verbose_msg_clients then begin
-        lprintf_nl () "HEADER FROM CLIENT:";
+        lprintf_nl "HEADER FROM CLIENT:";
         AnyEndian.dump_ascii header;
       end;
     let file = d.download_file in
@@ -134,7 +132,7 @@
       | _ -> failwith "Not a HTTP header line"
     in
     if !verbose_msg_clients then
-      lprintf_nl () "GOOD HEADER FROM CONNECTED CLIENT\n";
+      lprintf_nl "GOOD HEADER FROM CONNECTED CLIENT\n";
 
     set_rtimeout sock 120.;
 (*              lprintf "SPLIT HEADER...\n"; *)
@@ -154,12 +152,12 @@
             unknown_header := !unknown_header || not (List.mem header known_download_headers)
         ) headers;
         if !unknown_header then begin
-            lprintf_n () "Download Header contains unknown fields";
-            lprintf_nl2 "    %s" first_line;
+            lprintf_n "Download Header contains unknown fields";
+            lprintf_nl "    %s" first_line;
             List.iter (fun (header, (value,header2)) ->
-                lprintf_nl () "    [%s] = [%s](%s)" header value header2;
+                lprintf_nl "    [%s] = [%s](%s)" header value header2;
             ) headers;
-            lprintf_nl () "end of header";
+            lprintf_nl "end of header";
           end;
       end;
 
@@ -194,7 +192,7 @@
             x, Int64.succ y
         with
         | e ->
-            lprintf_nl () "Exception %s for range [%s]"
+            lprintf_nl "Exception %s for range [%s]"
               (Printexc2.to_string e) range;
             raise e
       with e ->
@@ -202,14 +200,14 @@
             if code <> 206 && code <> 200 then raise Not_found;
             let (len,_) = List.assoc "content-length" headers in
             let len = Int64.of_string len in
-            if !verbose then lprintf_nl () "Specified length: %Ld" len;
+            if !verbose then lprintf_nl "Specified length: %Ld" len;
             match d.download_ranges with
               [] -> raise Not_found
             | (start_pos,end_pos,r) :: _ ->
-                lprintf_nl () "WARNING: Assuming client is replying to range";
+                lprintf_nl "WARNING: Assuming client is replying to range";
                 if len <> end_pos -- start_pos then
                   begin
-                    lprintf_nl () "ERROR: bad computed range: %Ld-%Ld/%Ld \n%s"
+                    lprintf_nl "ERROR: bad computed range: %Ld-%Ld/%Ld \n%s"
                       start_pos end_pos len
                       (String.escaped header);
                     raise Not_found
@@ -218,7 +216,7 @@
           with _ ->
 (* A bit dangerous, no ??? *)
               if !verbose_unknown_messages then
-                lprintf_nl () "ERROR: Could not find/parse range header (exception %s), disconnect\nHEADER: %s"
+                lprintf_nl "ERROR: Could not find/parse range header (exception %s), disconnect\nHEADER: %s"
                     (Printexc2.to_string e)
                     (String.escaped header);
               disconnect_client c (Closed_for_error "Bad HTTP Range");
@@ -233,7 +231,7 @@
               start_pos end_pos len (String.escaped header))
           end
       with _ ->
-          lprintf_nl () "[WARNING]: no Content-Length field\n%s\n"
+          lprintf_nl "[WARNING]: no Content-Length field\n%s\n"
             (String.escaped header)
     );
 
@@ -275,7 +273,7 @@
                 CommonSwarming.received up
                   !counter_pos b.buf b.pos to_read_int;
           with e ->
-              lprintf_nl () "Exception %s in CommonSwarming.received"
+              lprintf_nl "Exception %s in CommonSwarming.received"
                 (Printexc2.to_string e)
         end;
         c.client_reconnect <- true;
@@ -287,7 +285,7 @@
         c.client_downloaded <- c.client_downloaded ++ (new_downloaded -- old_downloaded);
 
         (match d.download_ranges with
-            [] -> lprintf_nl () "EMPTY Ranges!"
+            [] -> lprintf_nl "EMPTY Ranges!"
           | r :: _ ->
 (*
               let (x,y) = CommonSwarming.range_range r in
@@ -325,7 +323,7 @@
   with e ->
       if !verbose_unknown_messages then
         begin
-          lprintf_nl () "Exception %s in client_parse_header" (Printexc2.to_string e);
+          lprintf_nl "Exception %s in client_parse_header" (Printexc2.to_string e);
           AnyEndian.dump header
         end;
       disconnect_client c (Closed_for_exception e);
@@ -357,14 +355,14 @@
     } in
 
   H.whead r (fun headers ->
-      if !verbose then lprintf_nl () "RECEIVED HEADERS";
+      if !verbose then lprintf_nl "RECEIVED HEADERS";
       let content_length = ref None in
       List.iter (fun (name, content) ->
           if String.lowercase name = "content-length" then
             try
               content_length := Some (Int64.of_string content)
             with _ ->
-                lprintf_nl () "bad content length [%s]" content;
+                lprintf_nl "bad content length [%s]" content;
       ) headers;
       match !content_length with
         None -> failwith "Unable to start download (HEAD failed)"
Index: src/networks/fileTP/fileTPInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fileTP/fileTPInteractive.ml,v
retrieving revision 1.36
diff -u -u -w -r1.36 fileTPInteractive.ml
--- src/networks/fileTP/fileTPInteractive.ml	12 May 2006 21:08:31 -0000	1.36
+++ src/networks/fileTP/fileTPInteractive.ml	19 May 2006 21:58:31 -0000
@@ -230,7 +230,7 @@
   let file = new_file (Md4.random ()) u.Url.full_file zero in
   
   if !verbose then
-    lprintf_nl () "Started new download: %s from %s" (file_best_name file) url; 
+    lprintf_nl "Started new download: %s from %s" (file_best_name file) url; 
   if not (List.memq file !current_files) then begin
       current_files := file :: !current_files;
     end;
@@ -267,7 +267,7 @@
   let location_regexp = "Location: \\(.*\\)" in
   let real_url = get_regexp_string url (Str.regexp location_regexp) in
   if !verbose then
-    lprintf_nl () "real url: %s\n" real_url;
+    lprintf_nl "real url: %s\n" real_url;
   if (is_http_torrent url real_url) then "", false
   else
     if (String2.check_prefix real_url "http://") then (
@@ -338,7 +338,7 @@
           | _ -> raise Not_found);
 
           if !verbose then
-            lprintf_nl () "MIRROR [%s] [%s]" !num !url;
+            lprintf_nl "MIRROR [%s] [%s]" !num !url;
           let u = Url.of_string !url in
 
           if List.mem u !!old_files && !previous_url <> !url then begin
@@ -348,10 +348,10 @@
           let num = int_of_string !num in
           Hashtbl.iter (fun _ file ->
               if !verbose then
-                lprintf_nl () "COMPARE %d/%d" (file_num file) num;
+                lprintf_nl "COMPARE %d/%d" (file_num file) num;
               if file_num file = num then begin
                   if !verbose then
-                    lprintf_nl () "Try HEAD from mirror";
+                    lprintf_nl "Try HEAD from mirror";
 
 
                   download_file_from_mirror file u !referer;
@@ -378,7 +378,7 @@
             _s ""
         | Not_found ->
             if !verbose then
-              lprintf_nl () "Not enough parameters";
+              lprintf_nl "Not enough parameters";
             let buf = o.conn_buf in
             if o.conn_output = HTML then
               html_mods_table_one_row buf "serversTable" "servers" [
Index: src/networks/gnutella/gnutellaClients.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaClients.ml,v
retrieving revision 1.40
diff -u -u -w -r1.40 gnutellaClients.ml
--- src/networks/gnutella/gnutellaClients.ml	12 May 2006 21:02:38 -0000	1.40
+++ src/networks/gnutella/gnutellaClients.ml	19 May 2006 21:58:31 -0000
@@ -554,7 +554,7 @@
                 iter ()
               with Not_found -> 
     if !verbose_unknown_messages then
-                  lprintf_nl () "Unable to get a block !!";
+                  lprintf_nl "Unable to get a block !!";
                   check_finished swarmer file;
                   raise Not_found
             in
@@ -582,12 +582,12 @@
 
 and disconnect_client c r =
   if !verbose then
-    lprintf_nl () "DISCONNECT CLIENT";
+    lprintf_nl "DISCONNECT CLIENT";
   match c.client_sock with
   | Connection sock -> 
       (try
           if !verbose_msg_clients then
-              lprintf_nl () "Disconnected from source for %s" (string_of_reason r); 
+              lprintf_nl "Disconnected from source for %s" (string_of_reason r); 
           c.client_requests <- [];
           connection_failed c.client_connection_control;
           set_client_disconnected c r;
Index: src/networks/gnutella/gnutellaGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaGlobals.ml,v
retrieving revision 1.38
diff -u -u -w -r1.38 gnutellaGlobals.ml
--- src/networks/gnutella/gnutellaGlobals.ml	17 May 2006 08:52:44 -0000	1.38
+++ src/networks/gnutella/gnutellaGlobals.ml	19 May 2006 21:58:31 -0000
@@ -44,15 +44,13 @@
 open GnutellaOptions
 open GnutellaNetwork
 
-(* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[Gnutella] "
-    (log_time ()); lprintf_nl2
-
-(* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[Gnutella] "
-    (log_time ()); lprintf
+let log_prefix = "[Gnutella]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let should_update_shared_files = ref false
 
@@ -339,7 +337,7 @@
     } 
   in
   if !verbose then
-    lprintf_nl () "SET SIZE : %Ld\n" file_size;
+    lprintf_nl "SET SIZE : %Ld\n" file_size;
   let kernel = CommonSwarming.create_swarmer file_temp file_size 
       (Int64.of_int (256 * 1024))  in
   let swarmer = CommonSwarming.create kernel (as_file file) megabyte in
@@ -543,7 +541,7 @@
 
 let disconnect_from_server s r =
   if !verbose then
-    lprintf_nl () "disconnect_from_server %s" (string_of_reason r);
+    lprintf_nl "disconnect_from_server %s" (string_of_reason r);
   match s.server_sock with
   | Connection sock ->
       let h = s.server_host in
@@ -552,7 +550,7 @@
             let connection_time = Int64.to_int (
                 Int64.sub (int64_time ()) s.server_connected) in
             if !verbose then
-              lprintf_nl () "disconnect_from_connected_server %s:%d after %d seconds (%s)\n"
+              lprintf_nl "disconnect_from_connected_server %s:%d after %d seconds (%s)\n"
                 (Ip.string_of_addr h.host_addr) h.host_port
                 connection_time (string_of_reason r)
             ;
Index: src/networks/gnutella/gnutellaHandler.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaHandler.ml,v
retrieving revision 1.13
diff -u -u -w -r1.13 gnutellaHandler.ml
--- src/networks/gnutella/gnutellaHandler.ml	17 May 2006 08:52:44 -0000	1.13
+++ src/networks/gnutella/gnutellaHandler.ml	19 May 2006 21:58:31 -0000
@@ -323,7 +323,7 @@
   
 with e ->
   if !verbose then
-  lprintf_nl () "server_to_client exception %s" (Printexc2.to_string e)
+  lprintf_nl "server_to_client exception %s" (Printexc2.to_string e)
   
 (*************************************************************************)
 (*                                                                       *)
Index: src/networks/gnutella/gnutellaInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaInteractive.ml,v
retrieving revision 1.53
diff -u -u -w -r1.53 gnutellaInteractive.ml
--- src/networks/gnutella/gnutellaInteractive.ml	17 May 2006 08:52:44 -0000	1.53
+++ src/networks/gnutella/gnutellaInteractive.ml	19 May 2006 21:58:31 -0000
@@ -94,12 +94,12 @@
 
 let result_download r =
   if !verbose then
-    lprintf_nl () "result_download";
+    lprintf_nl "result_download";
   let rec iter uids =
     match uids with
       [] -> raise IgnoreNetwork
     | uid :: tail ->
-        if !verbose then lprintf_nl () "UID: %s Accept(BP: %B ED2K: %B MD5: %B)" 
+        if !verbose then lprintf_nl "UID: %s Accept(BP: %B ED2K: %B MD5: %B)" 
             (Uid.to_string uid) 
             GnutellaNetwork.accept_bitprint
             GnutellaNetwork.accept_ed2kuid
@@ -115,49 +115,49 @@
         | _  -> iter tail
   in
   if !verbose then
-    lprintf_nl () "%d uids" (List.length r.result_uids);
+    lprintf_nl "%d uids" (List.length r.result_uids);
   iter r.result_uids
 
 let declare_file _ = should_update_shared_files := true
   
 let ask_for_uids sh =
-  if !verbose then lprintf_nl () "ask_for_uids Accept(BP: %B ED2K: %B MD5: %B)" 
+  if !verbose then lprintf_nl "ask_for_uids Accept(BP: %B ED2K: %B MD5: %B)" 
      GnutellaNetwork.accept_bitprint
      GnutellaNetwork.accept_ed2kuid
      GnutellaNetwork.accept_md5ext;
   let info = IndexedSharedFiles.get_result sh.shared_info in
   if GnutellaNetwork.accept_ed2kuid then begin
       if !verbose then
-        lprintf_nl () "Ask for ED2K uid";
+        lprintf_nl "Ask for ED2K uid";
       CommonUploads.ask_for_uid sh ED2K (fun sh uid ->
           let uid = Uid.to_string uid in
           declare_word uid;
           declare_file ();
           if !verbose then
-            lprintf_nl () "Ed2k uid available (size %d)" 
+            lprintf_nl "Ed2k uid available (size %d)" 
             (Array.length info.CommonUploads.shared_md4s);
       );
     end;
   if GnutellaNetwork.accept_md5ext then begin
       if !verbose then
-        lprintf_nl () "Ask for MD5EXT uid";
+        lprintf_nl "Ask for MD5EXT uid";
       CommonUploads.ask_for_uid sh MD5EXT (fun sh uid ->
           let uid = Uid.to_string uid in
           declare_word uid;
           declare_file ();          
           if !verbose then
-            lprintf_nl () "Md5ext uid available: %s"  uid
+            lprintf_nl "Md5ext uid available: %s"  uid
       );
     end;
 
   if GnutellaNetwork.accept_bitprint then begin
       if !verbose then
-        lprintf_nl () "Ask for BITPRINT uid";
+        lprintf_nl "Ask for BITPRINT uid";
       CommonUploads.ask_for_uid sh BITPRINT (fun sh uid ->
           declare_word uid;
           declare_file ();
           if !verbose then
-            lprintf_nl () "Bitprint tree available (size %d)" 
+            lprintf_nl "Bitprint tree available (size %d)" 
               (Array.length info.CommonUploads.shared_tiger);
           ()
       );
@@ -166,13 +166,13 @@
           declare_word uid;
           declare_file ();
           if !verbose then
-            lprintf_nl () "Tiger tree available (size %d)" 
+            lprintf_nl "Tiger tree available (size %d)" 
               (Array.length info.CommonUploads.shared_tiger);
       );
       CommonUploads.ask_for_uid sh SHA1 (fun sh uid -> 
           let uid = Uid.to_string uid in
           if !verbose_share then
-            lprintf_nl () "Could share urn: %s" uid;
+            lprintf_nl "Could share urn: %s" uid;
 (* TODO : enter this shared file in the QRT *)
           declare_word uid;
           declare_file ();          
Index: src/networks/gnutella/gnutellaMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaMain.ml,v
retrieving revision 1.23
diff -u -u -w -r1.23 gnutellaMain.ml
--- src/networks/gnutella/gnutellaMain.ml	17 May 2006 08:52:44 -0000	1.23
+++ src/networks/gnutella/gnutellaMain.ml	19 May 2006 21:58:31 -0000
@@ -111,11 +111,11 @@
     add_session_timer enabler 60.0 (fun timer ->
         ( try 
         GnutellaServers.ask_for_files ();
-          with e -> lprintf_nl () "ASK_FOR_FILE FAILED: %s" (Printexc2.to_string e));
+          with e -> lprintf_nl "ASK_FOR_FILE FAILED: %s" (Printexc2.to_string e));
 
         ( try
         GnutellaServers.send_pings ();
-        with e -> lprintf_nl () "SEND_PINGS FAILED: %s" (Printexc2.to_string e));  
+        with e -> lprintf_nl "SEND_PINGS FAILED: %s" (Printexc2.to_string e));  
 
         (* Connect only every 60 seconds to new servers to prevent
            hammering on them. It would be better to remember the
@@ -144,7 +144,7 @@
     let sock = (UdpSocket.create (Ip.to_inet_addr !!client_bind_addr)
         !!client_port udp_handler ) in
     if !verbose then
-      lprintf_nl () "UDP socket bound on port %d" !!client_port;
+      lprintf_nl "UDP socket bound on port %d" !!client_port;
     udp_sock := Some sock;
     
     UdpSocket.set_write_controler sock CommonGlobals.udp_write_controler;
Index: src/networks/gnutella/gnutellaProto.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaProto.ml,v
retrieving revision 1.13
diff -u -u -w -r1.13 gnutellaProto.ml
--- src/networks/gnutella/gnutellaProto.ml	17 May 2006 08:52:44 -0000	1.13
+++ src/networks/gnutella/gnutellaProto.ml	19 May 2006 21:58:31 -0000
@@ -508,7 +508,7 @@
   with e ->
       if !verbose_unknown_messages then
         begin
-          lprintf_nl () "Exception in parse: %s" (Printexc2.to_string e);
+          lprintf_nl "Exception in parse: %s" (Printexc2.to_string e);
           dump_hex pkt.pkt_payload;
         end;
       { pkt with pkt_payload = UnknownReq (pkt.pkt_type,pkt.pkt_payload) }
Index: src/networks/gnutella/gnutellaProtocol.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaProtocol.ml,v
retrieving revision 1.23
diff -u -u -w -r1.23 gnutellaProtocol.ml
--- src/networks/gnutella/gnutellaProtocol.ml	17 May 2006 08:52:44 -0000	1.23
+++ src/networks/gnutella/gnutellaProtocol.ml	19 May 2006 21:58:31 -0000
@@ -242,7 +242,7 @@
 
 let update_shared_words () = 
   if !verbose_share then
-    lprintf_nl () "update_shared_words";
+    lprintf_nl "update_shared_words";
   all_shared_words := [];
   cached_qrt_table := "";
   let module M = CommonUploads in
@@ -257,7 +257,7 @@
     List.iter (fun sh ->
         let info = IndexedSharedFiles.get_result sh.shared_info in
         if !verbose_share then
-          lprintf_nl () "CODED name: %s" sh.M.shared_codedname;
+          lprintf_nl "CODED name: %s" sh.M.shared_codedname;
         register_words sh.M.shared_codedname;
         List.iter (fun uid ->
             words := WordSet.add (Uid.to_string uid) !words
@@ -330,12 +330,12 @@
           List.assoc "x-gnutella-alternate-location" headers in
         let locations = String2.split locations ',' in
         
-        lprintf_nl () "Alternate locations";
+        lprintf_nl "Alternate locations";
         let urls = List.map (fun s ->
               match String2.split_simplify s ' ' with
-                [] -> lprintf_nl () "Cannot parse : %s" s; ""
+                [] -> lprintf_nl "Cannot parse : %s" s; ""
               | url :: _ ->
-                  lprintf_nl () "  Location: %s" url; url
+                  lprintf_nl "  Location: %s" url; url
           ) locations in
         lprint_newline ();
         
@@ -538,7 +538,7 @@
       match url.Url.args with
         [(urn,_)] ->
           if !verbose_msg_clients then
-            lprintf_nl () "Found /uri-res/N2R request";
+            lprintf_nl "Found /uri-res/N2R request";
           find_by_uid (Uid.of_string urn)
       
       | _ -> failwith "Cannot parse /uri-res/N2R request"
@@ -549,7 +549,7 @@
     let num = String.sub file 5 (pos - 5) in
     let filename = String.sub file (pos+1) (String.length file - pos - 1) in
     if !verbose_msg_clients then
-      lprintf_nl () "Download of file %s, filename = %s" num filename;
+      lprintf_nl "Download of file %s, filename = %s" num filename;
     let num = int_of_string num in
     Hashtbl.find shareds_by_id  num
   in
Index: src/networks/gnutella/gnutellaRedirector.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaRedirector.ml,v
retrieving revision 1.13
diff -u -u -w -r1.13 gnutellaRedirector.ml
--- src/networks/gnutella/gnutellaRedirector.ml	14 May 2006 19:09:21 -0000	1.13
+++ src/networks/gnutella/gnutellaRedirector.ml	19 May 2006 21:58:31 -0000
@@ -47,13 +47,13 @@
   let s = File.to_string file in
   (* Http_client.wget does not delete the temp file anymore *)
   (try Sys.remove file with _ -> ());
-  if !verbose then lprintf_nl () "Parsing urlfile from %s:\n%s" url_string s;
+  if !verbose then lprintf_nl "Parsing urlfile from %s:\n%s" url_string s;
   clean_file s;
   let lines = String2.split_simplify s '\n' in
   List.iter (fun line ->
       if not (List.mem line !!gnutella_hostfiles) then begin
         gnutella_hostfiles =:= line :: !!gnutella_hostfiles;
-        if !verbose then lprintf_nl () "Added GWebCache %s" line;
+        if !verbose then lprintf_nl "Added GWebCache %s" line;
       end
   ) lines;
   redirectors_hostfiles := !!gnutella_hostfiles
@@ -67,9 +67,9 @@
           (* 12 hour interval between urlfile re-connection attempts *)
           next_urlfile_access := last_time () + (3600*12);
           redirectors_urlfiles := !!urlfiles;
-          lprintf_nl () "added %d urlfiles" (List.length !!urlfiles);
+          lprintf_nl "added %d urlfiles" (List.length !!urlfiles);
       end else begin
-        if !verbose then lprintf_nl () "connect_urlfile: no urlfiles, too soon";
+        if !verbose then lprintf_nl "connect_urlfile: no urlfiles, too soon";
       end
   | url :: tail ->
       redirectors_urlfiles := tail;
@@ -84,28 +84,28 @@
           H.req_user_agent = get_user_agent ();
         } in
       if !verbose then
-        lprintf_nl () "Connecting to urlfile %s\n" url;
+        lprintf_nl "Connecting to urlfile %s\n" url;
       H.wget r (fun filename -> parse_urlfile filename url_string)
       
 let parse_hostfile file url_string = 
   let s = File.to_string file in
   if String2.starts_with s "ERROR" || String2.starts_with s "<" then begin
-    if !verbose then lprintf_nl () "Malformed response content:\n%s" s;
+    if !verbose then lprintf_nl "Malformed response content:\n%s" s;
     if List.mem url_string !!gnutella_hostfiles then begin
       gnutella_hostfiles =:= List.filter (fun h -> h <> url_string) !!gnutella_hostfiles;
       redirectors_hostfiles := !!gnutella_hostfiles;
-      if !verbose then lprintf_nl () "Removing %s from hostfiles" url_string;
+      if !verbose then lprintf_nl "Removing %s from hostfiles" url_string;
     end;
   end
   else begin
     clean_file s;
     let lines = String2.split_simplify s '\n' in
-    if !verbose then lprintf_nl () "Parsing response from %s:\n%s" url_string s;
+    if !verbose then lprintf_nl "Parsing response from %s:\n%s" url_string s;
     List.iter (fun line ->
       try
         let ip, port = String2.cut_at line ':' in
         if !verbose then
-          lprintf_nl () "Adding ultrapeer from hostfile %s %s" ip port;
+          lprintf_nl "Adding ultrapeer from hostfile %s %s" ip port;
         ignore (H.new_host (Ip.addr_of_string ip) (int_of_string port) Ultrapeer)
       with _ -> ()
     ) lines
@@ -122,7 +122,7 @@
           redirectors_hostfiles := !!gnutella_hostfiles
       end 
       else begin
-        if !verbose then lprintf_nl () "connect_hostfile: no gwebcaches, too soon";
+        if !verbose then lprintf_nl "connect_hostfile: no gwebcaches, too soon";
       end;
       connect_urlfile ();
   | url :: tail ->
@@ -138,7 +138,7 @@
           H.req_user_agent = get_user_agent ();
         } in
       if !verbose then
-        lprintf_nl () "Connecting to hostfile %s" url;
+        lprintf_nl "Connecting to hostfile %s" url;
       H.wget r (fun filename -> parse_hostfile filename url_string)
       
 let connect _ = 
Index: src/networks/gnutella/gnutellaServers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaServers.ml,v
retrieving revision 1.27
diff -u -u -w -r1.27 gnutellaServers.ml
--- src/networks/gnutella/gnutellaServers.ml	17 May 2006 08:52:44 -0000	1.27
+++ src/networks/gnutella/gnutellaServers.ml	19 May 2006 21:58:32 -0000
@@ -129,7 +129,7 @@
 (*************************************************************************)
          
 let send_pings () =
-  if !verbose then lprintf_nl () "send_pings";
+  if !verbose then lprintf_nl "send_pings";
   try
   if !new_shared_words then update_shared_words ();
   List.iter (fun s ->      
@@ -143,7 +143,7 @@
           host_send_qkr s.server_host           
       | _ -> 
           if !verbose then
-            lprintf_nl () "Udp Support present";
+            lprintf_nl "Udp Support present";
           ()
   ) !connected_servers;
   new_shared_words := false;
@@ -155,7 +155,7 @@
   on_send_pings ();
 
   with e -> 
-    lprintf_nl () "send_pings: %s" (Printexc2.to_string e)
+    lprintf_nl "send_pings: %s" (Printexc2.to_string e)
 
 
   
@@ -205,7 +205,7 @@
   
 let connect_servers connect =
 
-  if !verbose then lprintf_nl () "connect_servers c: %d n: %d max: %d\n" (List.length !connected_servers) !nservers !!max_ultrapeers; 
+  if !verbose then lprintf_nl "connect_servers c: %d n: %d max: %d\n" (List.length !connected_servers) !nservers !!max_ultrapeers; 
 
   (if !!max_ultrapeers > List.length !connected_servers then
       try
@@ -226,7 +226,7 @@
                   UdpQueryKey _ -> false
                 | _ -> true
           ) then begin
-            if !verbose then lprintf_nl () "host_send_qkr...\n"; 
+            if !verbose then lprintf_nl "host_send_qkr...\n"; 
             H.set_request h Udp_Connect;
             host_send_qkr h
           end
@@ -247,12 +247,12 @@
           unknown_header := !unknown_header || not (List.mem header GnutellaProto.known_supernode_headers)
       ) headers;
       if !unknown_header then begin
-          lprintf_nl () "Gnutella DEVEL: Supernode Header contains unknown fields";
-          lprintf_nl () "    %s" first_line;
+          lprintf_nl "Gnutella DEVEL: Supernode Header contains unknown fields";
+          lprintf_nl "    %s" first_line;
           List.iter (fun (header, (value,header2)) ->
               lprintf "    [%s] = [%s](%s)\n" header value header2;
           ) headers;
-          lprintf_nl () "Gnutella DEVEL: end of header";        
+          lprintf_nl "Gnutella DEVEL: end of header";        
         end;
     end;
   
@@ -400,7 +400,7 @@
     failwith "Protocol not supported";
   List.iter (fun (ip,port,ultrapeer) ->
       try
-        if !verbose then lprintf_nl () "x_ultrapeers new Ultrapeer %s %d" (Ip.string_of_addr ip) port;
+        if !verbose then lprintf_nl "x_ultrapeers new Ultrapeer %s %d" (Ip.string_of_addr ip) port;
         ignore (H.new_host ip port ultrapeer)
       with e ->
           if !verbose_msg_servers then begin
@@ -483,7 +483,7 @@
 
     let msg = make_http_header "GNUTELLA/0.6 200 OK" headers in
     if !verbose_msg_servers then
-      lprintf_nl () "CONNECT REQUEST %s: %s\n" (Ip.to_string (peer_ip sock)) (String.escaped msg); 
+      lprintf_nl "CONNECT REQUEST %s: %s\n" (Ip.to_string (peer_ip sock)) (String.escaped msg); 
     write_string sock msg;
     
     if h.hsrpl_content_deflate then deflate_connection sock;
@@ -495,7 +495,7 @@
     ()
   with e ->      
       if !verbose_msg_servers then
-        lprintf_nl () "DISCONNECT WITH EXCEPTION %s" (Printexc2.to_string e); 
+        lprintf_nl "DISCONNECT WITH EXCEPTION %s" (Printexc2.to_string e); 
       disconnect_from_server s (Closed_for_exception e)
   
 (*************************************************************************)
@@ -584,7 +584,7 @@
                 failwith "Invalid IP for server\n";
               let port = s.server_host.host_port in
               if !verbose_msg_servers then 
-                lprintf_nl () "CONNECT TO %s:%d" (Ip.to_string ip) port;
+                lprintf_nl "CONNECT TO %s:%d" (Ip.to_string ip) port;
               H.set_request h Tcp_Connect;
               H.try_connect h;
 (*                h.host_tcp_request <- last_time (); *)
@@ -633,7 +633,7 @@
               in
 
                 if !verbose_msg_servers then
-                  lprintf_nl () "SENDING %s" (String.escaped s);
+                  lprintf_nl "SENDING %s" (String.escaped s);
                 write_string sock s;
               with e ->
                   disconnect_from_server s
Index: src/networks/gnutella2/g2Handler.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella2/g2Handler.ml,v
retrieving revision 1.19
diff -u -u -w -r1.19 g2Handler.ml
--- src/networks/gnutella2/g2Handler.ml	17 May 2006 08:52:44 -0000	1.19
+++ src/networks/gnutella2/g2Handler.ml	19 May 2006 21:58:32 -0000
@@ -74,7 +74,7 @@
 let g2_packet_handler s sock gconn p = 
   let h = s.server_host in
   if !verbose_msg_servers then begin
-      lprintf_nl () "Received %s packet from %s:%d: %s" 
+      lprintf_nl "Received %s packet from %s:%d: %s" 
         (match sock with Connection _  -> "TCP" | _ -> "UDP")
       (Ip.string_of_addr h.host_addr) h.host_port
         (Print.print p);
@@ -303,7 +303,7 @@
           match c.g2_payload with
             KHL_NH (ip,port) 
           | KHL_CH ((ip,port),_) ->
-              if !verbose then lprintf_nl () "KHL new Ultrapeer: %s %d" (Ip.to_string ip) port;
+              if !verbose then lprintf_nl "KHL new Ultrapeer: %s %d" (Ip.to_string ip) port;
               ignore (H.new_host (Ip.addr_of_ip ip) port Ultrapeer);
               List.iter (fun c ->
                   match c.g2_payload with
@@ -314,28 +314,26 @@
                       Some s -> 
                         s.server_nfiles <- f;
                         server_must_update (as_server s.server_server);
-                     | _ -> (if !verbose then lprintf_nl () "KHL LS: No server found: %s %d" (Ip.to_string ip) port)  
+                     | _ -> (if !verbose then lprintf_nl "KHL LS: No server found: %s %d" (Ip.to_string ip) port)  
                     )
 
                   | KHL_NH_HS (l,ml) 
                   | KHL_CH_HS (l,ml) -> (
-                    lprintf_nl () "KHL HS";
                     let s = find_server (Ip.addr_of_ip ip) port in
                     match s with 
                       Some s -> 
                         s.server_nusers <- Int64.of_int l;
                         s.server_maxnusers <- Int64.of_int ml;
                         server_must_update (as_server s.server_server);
-                     | _ -> (if !verbose then lprintf_nl () "KHL HS: No server found: %s %d" (Ip.to_string ip) port)
+                     | _ -> (if !verbose then lprintf_nl "KHL HS: No server found: %s %d" (Ip.to_string ip) port)
                     )
                   | KHL_NH_V v 
                   | KHL_CH_V v -> (
-                    lprintf_nl () "KHL HS";
                     let s = find_server (Ip.addr_of_ip ip) port in
                     match s with 
                       Some s -> 
                         if s.server_vendor = "" then s.server_vendor <- v;
-                     | _ -> (if !verbose then lprintf_nl () "KHL V: No server found: %s %d" (Ip.to_string ip) port)
+                     | _ -> (if !verbose then lprintf_nl "KHL V: No server found: %s %d" (Ip.to_string ip) port)
                     )
                   | _ -> ()
               ) c.g2_children
@@ -353,7 +351,7 @@
       List.iter (fun c ->
           match c.g2_payload with
           | QA_D ((ip,port),_) ->
-              if !verbose then lprintf_nl () "QA_D new Ultrapeer: %s %d" (Ip.to_string ip) port;
+              if !verbose then lprintf_nl "QA_D new Ultrapeer: %s %d" (Ip.to_string ip) port;
               let h = H.new_host (Ip.addr_of_ip ip) port Ultrapeer in
               H.connected h;
               begin
@@ -364,7 +362,7 @@
               end
 (* These ones have not been searched yet *)
           | QA_S ((ip,port),_) -> 
-              if !verbose then lprintf_nl () "QA_S new Ultrapeer: %s %d" (Ip.to_string ip) port;
+              if !verbose then lprintf_nl "QA_S new Ultrapeer: %s %d" (Ip.to_string ip) port;
               let h = H.new_host (Ip.addr_of_ip ip) port Ultrapeer in
               H.connected h;
           
@@ -462,7 +460,7 @@
                   xml_info := Some xml
                 with e ->
                     if !verbose_unknown_messages then
-                      lprintf_nl () "Exception %s while parsing: \n%s"
+                      lprintf_nl "Exception %s while parsing: \n%s"
                         (Printexc2.to_string e) xml
               
               end
@@ -484,7 +482,7 @@
                 ) user_files files
               end else begin
                 if !verbose_unknown_messages then
-                  lprintf_nl () "ERROR: Not enough XML entries %d/%d"
+                  lprintf_nl "ERROR: Not enough XML entries %d/%d"
                     (List.length files) (List.length user_files);
                 user_files 
               end
@@ -492,7 +490,7 @@
       in
       
       if !verbose_msg_servers then begin
-          lprintf_nl () "Results Received:";
+          lprintf_nl "Results Received:";
           List.iter (fun (urn, size, name, url, tags) ->
               lprintf "[name %s] [size %s] [urn %s] [url %s]\n"
                 name (match size with
@@ -586,17 +584,17 @@
       
   | _ -> 
       if !verbose_unknown_messages then
-        lprintf_nl () "g2_packet_handler: unexpected packet %s"
+        lprintf_nl "g2_packet_handler: unexpected packet %s"
         (Print.print p)
 
 with e ->
   if !verbose then
-  lprintf_nl () "g2_packet_handler exception: %s" (Printexc2.to_string e) 
+  lprintf_nl "g2_packet_handler exception: %s" (Printexc2.to_string e) 
   
           
 let udp_packet_handler ip port msg = 
   let addr = Ip.addr_of_ip ip in
-  (* if !verbose then lprintf_nl () "udp_packet_handler new Ultrapeer: %s %d" (Ip.to_string ip) port; *)
+  (* if !verbose then lprintf_nl "udp_packet_handler new Ultrapeer: %s %d" (Ip.to_string ip) port; *)
   let h = H.new_host addr port Ultrapeer in
   H.connected h;
 (*  if !verbose_udp then
@@ -621,7 +619,7 @@
 
 let init s sock gconn = 
 (*  gconn.gconn_sock <- s.server_sock; *)
-  if !verbose then lprintf_nl () "init: %s" (Ip.to_string (peer_ip sock));
+  if !verbose then lprintf_nl "init: %s" (Ip.to_string (peer_ip sock));
 
   connected_servers := s :: !connected_servers;
   gconn.gconn_handler <- Reader (g2_handler (g2_packet_handler s s.server_sock));
@@ -657,7 +655,7 @@
 
       (*
       if !verbose then begin 
-        lprintf_nl () "udp_client_handler %s %d" (Ip.to_string ip) port;
+        lprintf_nl "udp_client_handler %s %d" (Ip.to_string ip) port;
         AnyEndian.dump_hex buf;
       end;
       *)
@@ -665,13 +663,13 @@
       udp_packet_handler ip port x
 
     with AckPacket | FragmentedPacket -> 
-      (* if !verbose then lprintf_nl () "ACK/FRAGMENT" *)
+      (* if !verbose then lprintf_nl "ACK/FRAGMENT" *)
 
       ()
     
   else
     if !verbose then begin
-      lprintf_nl () "Unexpected UDP packet:";
+      lprintf_nl "Unexpected UDP packet:";
       AnyEndian.dump_hex buf;
     end
       
Index: src/networks/gnutella2/g2Proto.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella2/g2Proto.ml,v
retrieving revision 1.16
diff -u -u -w -r1.16 g2Proto.ml
--- src/networks/gnutella2/g2Proto.ml	17 May 2006 08:52:44 -0000	1.16
+++ src/networks/gnutella2/g2Proto.ml	19 May 2006 21:58:32 -0000
@@ -582,7 +582,7 @@
       (len_len lsl 6) lor ((name_len-1) lsl 3)
   in
   let cb = if cb=0 then cb+4 else cb in
- (* if !verbose then lprintf_nl () "2encode: cb=%d size=%d len_len=%d" cb !size len_len; *)
+ (* if !verbose then lprintf_nl "2encode: cb=%d size=%d len_len=%d" cb !size len_len; *)
   
   Buffer.add_char buf (char_of_int cb);
   if len_len = 1 then 
@@ -609,7 +609,7 @@
     if be then 
       (
        if !verbose then
-         lprintf_nl () "Big Endian not supported yet";
+         lprintf_nl "Big Endian not supported yet";
        raise Exit
       );
     let module M = G2_LittleEndian in
@@ -766,7 +766,7 @@
   with e ->
       if !verbose_unknown_messages then
         begin
-          lprintf_nl () "g2_decode_payload cannot parse: %s" (Printexc2.to_string e);
+          lprintf_nl "g2_decode_payload cannot parse: %s" (Printexc2.to_string e);
           List.iter (fun name -> lprintf "/%s" name) (List.rev names);
           lprintf "\n%s\n" (sdump s);
         end;
@@ -834,7 +834,7 @@
   let msg_len = 1 + len_len + name_len + pkt_len in
   (*
   if !verbose then 
-    lprintf_nl () "g2_extract_packet: be:%B len: %d len_len: %d pkt_len: %d pkt_pos: %d name_len: %d msg_len: %d" 
+    lprintf_nl "g2_extract_packet: be:%B len: %d len_len: %d pkt_len: %d pkt_pos: %d name_len: %d msg_len: %d" 
       be len len_len pkt_len pkt_pos name_len msg_len;
   *)
 
@@ -853,7 +853,7 @@
   do_if_connected sock (fun sock ->
       let m = g2_encode p in
       if !verbose then begin 
-        lprintf_nl () "socket_send_sock %s:" (Ip.to_string (peer_ip sock));
+        lprintf_nl "socket_send_sock %s:" (Ip.to_string (peer_ip sock));
         dump_hex m; 
       end;
       write_string sock m
@@ -883,14 +883,14 @@
               let (s,ip,port,seq,times, next_time,acked) = 
                 Fifo.take udp_packet_waiting_for_ack in
               if not !acked then begin
-                  if !verbose then lprintf_nl () "resend_udp_packets %s %d: %d" (Ip.to_string ip) port seq;
+                  if !verbose then lprintf_nl "resend_udp_packets %s %d: %d" (Ip.to_string ip) port seq;
                   UdpSocket.write sock false s ip port;
                   if times < 3 then 
                     Fifo.put udp_packet_waiting_for_ack (s, ip, port, seq, 
                       times+1, 
                       last_time () + 10, acked)
                   else begin
-                    if !verbose then lprintf_nl () "resend_udp_packets: packet %d lost" seq;
+                    if !verbose then lprintf_nl "resend_udp_packets: packet %d lost" seq;
                   end
                 end;
             end else
@@ -914,7 +914,7 @@
         in
             
         if !verbose_msg_servers then begin
-            lprintf_nl () "Sending on UDP(%d)%s to %s:%d: %s"
+            lprintf_nl "Sending on UDP(%d)%s to %s:%d: %s"
               !udp_counter
               (if compress then " (zlib)" else "")
               (Ip.to_string ip) port
@@ -937,7 +937,7 @@
           (char_of_int (counter land 0xff))
           (char_of_int ((counter lsr 8) land 0xff))
         in
-        (* if !verbose then lprintf_nl () "udp_send_ack: %s %d" (Ip.to_string ip) port; *)
+        (* if !verbose then lprintf_nl "udp_send_ack: %s %d" (Ip.to_string ip) port; *)
         UdpSocket.write sock false s ip port
       with e ->
           lprintf "Exception %s in udp_send\n" (Printexc2.to_string e)
@@ -950,7 +950,7 @@
   match sock with
   | Connection _   ->
       if !verbose_msg_servers then
-        lprintf_nl () "Sending on TCP to %s:%d: %s" 
+        lprintf_nl "Sending on TCP to %s:%d: %s" 
           (Ip.to_string ip) port (Print.print p);
       socket_send sock p
   | _ -> 
@@ -962,18 +962,18 @@
   let b = TcpBufferedSocket.buf sock in
 
   if !verbose then begin
-    lprintf_nl () "g2_handler:";
+    lprintf_nl "g2_handler:";
     AnyEndian.dump_hex (String.sub b.buf b.pos b.len);
   end;
 
   try
     while b.len >= 2 do
       let s = b.buf in
-      (* if !verbose then lprintf_nl () "g2_tcp_packet_handler"; *)
+      (* if !verbose then lprintf_nl "g2_tcp_packet_handler"; *)
       let cb = get_uint8 s b.pos in
       let len_len = (cb lsr 6) land 3 in
       let be = cb land 2 <> 0 in
-      (* if !verbose then lprintf_nl () "b.len: %d < 1 + len_len: %d be: %B" b.len len_len be; *)
+      (* if !verbose then lprintf_nl "b.len: %d < 1 + len_len: %d be: %B" b.len len_len be; *)
 
       if b.len < 1 + len_len then raise Not_found;
       
@@ -989,10 +989,10 @@
       let name_len = ((cb lsr 3) land 7) + 1 in
       let msg_len = 1 + len_len + name_len + len in
       (* if !verbose then
-        lprintf_nl () "b.len: %d < msg_len: %d name_len: %d" b.len msg_len name_len; *)
+        lprintf_nl "b.len: %d < msg_len: %d name_len: %d" b.len msg_len name_len; *)
       if b.len < msg_len then raise Not_found;
       
-      (* if !verbose then lprintf_nl () "One gnutella2 packet received";  *)
+      (* if !verbose then lprintf_nl "One gnutella2 packet received";  *)
       let name = String.sub b.buf (b.pos + pos) name_len in
       let packet = String.sub b.buf (b.pos + pos + name_len) len in
       let has_children = cb land 4 <> 0 in
@@ -1044,7 +1044,7 @@
 
   (*
   if !verbose then begin
-    lprintf_nl () "NEW UDP PACKET FROM %s %d:" (Ip.to_string ip) port;
+    lprintf_nl "NEW UDP PACKET FROM %s %d:" (Ip.to_string ip) port;
     AnyEndian.dump_hex buf;
   end;
   *)
@@ -1127,7 +1127,7 @@
     
     
     if !verbose then begin
-      lprintf_nl () "FULL UDP PACKET FROM %s %d:" (Ip.to_string ip) port;
+      lprintf_nl "FULL UDP PACKET FROM %s %d:" (Ip.to_string ip) port;
       AnyEndian.dump_hex buf;
     end;
     
@@ -1147,7 +1147,7 @@
         | 3, false -> LittleEndian.get_int24 buf (pos+1), 4
         | _ ->
             if !verbose then
-              lprintf_nl () "no correct pkt_len, pkt_pos";
+              lprintf_nl "no correct pkt_len, pkt_pos";
             0, 1
       in
       let name_len = ((cb lsr 3) land 7) + 1 in
@@ -1171,7 +1171,7 @@
       let has_children = cb land 4 <> 0 in
       let p = g2_parse [name] has_children be packet in
       if !verbose_msg_servers then
-        lprintf_nl () "UDP PACKET: %s" (Print.print p); 
+        lprintf_nl "UDP PACKET: %s" (Print.print p); 
       
 (* Test Encoder *)
       
@@ -1354,7 +1354,7 @@
 
   
 let host_send_qkr h =
-  if !verbose then lprintf_nl () "host_send_qkr";
+  if !verbose then lprintf_nl "host_send_qkr";
   host_send NoConnection h
     (packet QKR [])
 
@@ -1600,7 +1600,7 @@
         | 3, false -> LittleEndian.get_int24 buf (pos+1), 4
         | _ ->
             if !verbose then
-              lprintf_nl () "no correct pkt_len, pkt_pos";
+              lprintf_nl "no correct pkt_len, pkt_pos";
             0, 1
       in
       let name_len = ((cb lsr 3) land 7) + 1 in
Index: src/networks/gnutella2/g2Redirector.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella2/g2Redirector.ml,v
retrieving revision 1.10
diff -u -u -w -r1.10 g2Redirector.ml
--- src/networks/gnutella2/g2Redirector.ml	17 May 2006 08:52:44 -0000	1.10
+++ src/networks/gnutella2/g2Redirector.ml	19 May 2006 21:58:32 -0000
@@ -48,14 +48,14 @@
           begin
             try
               let ip, port = String2.cut_at ip_port ':' in
-              if !verbose then lprintf_nl () "Received host %s:%s" ip port;
+              if !verbose then lprintf_nl "Received host %s:%s" ip port;
                 ignore (H.new_host (Ip.addr_of_string ip) (int_of_string port) Ultrapeer)
             with _ -> ()
           end
       | "u" :: url :: _ ->
           if not (List.mem url !!redirectors) then begin
             redirectors =:= url :: !!redirectors;
-            if !verbose then lprintf_nl () "Received redirector %s" url
+            if !verbose then lprintf_nl "Received redirector %s" url
           end
       | _ -> ()
   ) lines
@@ -80,12 +80,12 @@
               H.req_user_agent = get_user_agent ();
             } in
           if !verbose then
-            lprintf_nl () "Connecting G2 redirector: %s" url;
+            lprintf_nl "Connecting G2 redirector: %s" url;
           H.wget r g2_parse_redirector_page    
       ) !!redirectors;
     end else begin
       if !verbose then
-        lprintf_nl () "redirector recontacted in %d seconds"
+        lprintf_nl "redirector recontacted in %d seconds"
           (!next_redirector_access - last_time ())
     end
     
Index: src/networks/gnutella2/g2Supernode.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/gnutella2/g2Supernode.ml,v
retrieving revision 1.2
diff -u -u -w -r1.2 g2Supernode.ml
--- src/networks/gnutella2/g2Supernode.ml	17 May 2006 08:52:44 -0000	1.2
+++ src/networks/gnutella2/g2Supernode.ml	19 May 2006 21:58:32 -0000
@@ -340,7 +340,7 @@
         (make_handshake_request_headers req)
     in
     if !verbose_msg_servers then
-      lprintf_nl () "SENDING %s\n" (String.escaped msg);
+      lprintf_nl "SENDING %s\n" (String.escaped msg);
     
     write_string sock msg;
     set_gnutella_sock sock !verbose_msg_servers
Index: src/networks/soulseek/slskServers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/soulseek/slskServers.ml,v
retrieving revision 1.12
diff -u -u -w -r1.12 slskServers.ml
--- src/networks/soulseek/slskServers.ml	10 Apr 2006 19:16:36 -0000	1.12
+++ src/networks/soulseek/slskServers.ml	19 May 2006 21:58:34 -0000
@@ -225,7 +225,7 @@
         match String2.split_simplify s ':' with
           [_;_;server_name; server_port] -> 
             let port = int_of_string server_port in
-            lprintf_nl () "NEW SERVER %s:%d" server_name port;
+            lprintf_nl "NEW SERVER %s:%d" server_name port;
             (*
             main_server_name =:= server_name;
 main_server_port =:= port;
Index: src/utils/cdk/printf2.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/cdk/printf2.ml,v
retrieving revision 1.16
diff -u -u -w -r1.16 printf2.ml
--- src/utils/cdk/printf2.ml	17 May 2006 08:52:44 -0000	1.16
+++ src/utils/cdk/printf2.ml	19 May 2006 21:58:34 -0000
@@ -198,12 +198,16 @@
   cprintf (fun s -> try !lprintf_handler s with _ -> ())
   (fmt : ('a,unit, unit) format )
 
+let lprintf2 m fmt =
+  cprintf (fun s -> try !lprintf_handler ((log_time ())^m^" "^s) with _ -> ())
+  (fmt : ('a,unit, unit) format )
+
 let lprintf_nl fmt =
   cprintf (fun s -> try !lprintf_handler ((log_time ())^s^"\n") with _ -> ())
   (fmt : ('a,unit, unit) format )
 
-let lprintf_nl2 fmt =
-  cprintf (fun s -> try !lprintf_handler (s^"\n") with _ -> ())
+let lprintf_nl2 m fmt =
+  cprintf (fun s -> try !lprintf_handler ((log_time ())^m^" "^s^"\n") with _ -> ())
   (fmt : ('a,unit, unit) format )
 
 let lprint_newline () = lprintf "\n"
Index: src/utils/cdk/printf2.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/cdk/printf2.mli,v
retrieving revision 1.5
diff -u -u -w -r1.5 printf2.mli
--- src/utils/cdk/printf2.mli	7 Nov 2005 20:11:43 -0000	1.5
+++ src/utils/cdk/printf2.mli	19 May 2006 21:58:34 -0000
@@ -26,8 +26,9 @@
     result of [k] is then returned as the result of [cprintf]. *)
 
 val lprintf :  ('a, unit, unit) format -> 'a
+val lprintf2 :  string -> ('a, unit, unit) format -> 'a
 val lprintf_nl :  ('a, unit, unit) format -> 'a
-val lprintf_nl2 :  ('a, unit, unit) format -> 'a
+val lprintf_nl2 : string -> ('a, unit, unit) format -> 'a
 val lprint_newline : unit -> unit  
 val lprint_char : char -> unit  
 val lprint_string : string -> unit  
Index: src/utils/lib/unix32.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/unix32.ml,v
retrieving revision 1.61
diff -u -u -w -r1.61 unix32.ml
--- src/utils/lib/unix32.ml	13 Apr 2006 23:55:25 -0000	1.61
+++ src/utils/lib/unix32.ml	19 May 2006 21:58:35 -0000
@@ -22,10 +22,10 @@
 open Int64ops
 open Printf2
 
-let lprintf_nl =
-  (fun format ->
-     lprintf "%s[Ux32] " (log_time ()); 
-     lprintf_nl2 format)
+let log_prefix = "[Ux32]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
   
 let chunk_min_size = ref 65000L
   
Index: src/utils/net/http_client.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/http_client.ml,v
retrieving revision 1.31
diff -u -u -w -r1.31 http_client.ml
--- src/utils/net/http_client.ml	15 May 2006 17:45:35 -0000	1.31
+++ src/utils/net/http_client.ml	19 May 2006 21:58:36 -0000
@@ -56,9 +56,10 @@
 type content_handler = 
   int -> (string * string) list -> TcpBufferedSocket.t -> int -> unit
 
-let lprintf_nl () =
-  lprintf "%s[HTTPcl] "
-      (log_time ()); lprintf_nl2
+let log_prefix = "[HTTPcl]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
 
 let basic_request = {
     req_url = Url.of_string "http://www.mldonkey.net/";
@@ -122,7 +123,7 @@
     Buffer.add_string res "\r\n";
   let s = Buffer.contents res in
   if !verbose then
-    lprintf_nl () "make_full_request on URL: %s" (String.escaped s);
+    lprintf_nl "make_full_request on URL: %s" (String.escaped s);
   s
 
 let split_head s =
@@ -144,7 +145,7 @@
   match headers with 
     [] -> failwith "Ill formed reply"
   | ans :: headers ->
-      if !verbose then lprintf_nl () "parse_header: ANSWER %s" ans;
+      if !verbose then lprintf_nl "parse_header: ANSWER %s" ans;
       let ans_code = int_of_string (String.sub ans 9 3) in
       let headers = List.map (fun s ->
             let sep = String.index s ':' in
@@ -244,7 +245,7 @@
         in
         let nread = ref false in
         if !verbose then 
-          lprintf_nl () "get_page: %s" (String.escaped request);
+          lprintf_nl "get_page: %s" (String.escaped request);
         TcpBufferedSocket.write_string sock request;
         TcpBufferedSocket.set_reader sock (http_reply_handler nread
             (default_headers_handler url level));
@@ -254,13 +255,13 @@
         )
 
     )
-  with e -> lprintf_nl () "error in get_url"; raise Not_found
+  with e -> lprintf_nl "error in get_url"; raise Not_found
 
   and default_headers_handler old_url level sock ans_code headers =
     let print_headers () =
       List.iter
         (fun (name, value) ->
-          lprintf_nl () "[%s]=[%s]" name value;
+          lprintf_nl "[%s]=[%s]" name value;
         ) headers;
     in
     if !verbose then print_headers ();
@@ -278,7 +279,7 @@
               try
                 content_length := int_of_string content
               with _ -> 
-                  lprintf_nl () "bad content length [%s]" content;
+                  lprintf_nl "bad content length [%s]" content;
         ) headers;
         let location = "Location", Url.to_string old_url in
         let content_handler = content_handler !content_length (location::headers) in
@@ -288,7 +289,7 @@
           content_handler sock buf.len
 
     | 301 | 302 | 304 ->
-        if !verbose then lprintf_nl () "%d: Redirect" ans_code;
+        if !verbose then lprintf_nl "%d: Redirect" ans_code;
   let retrynum = r.req_retry in
         if retrynum < r.req_max_retry then
           begin
@@ -311,7 +312,7 @@
                     (if old_url.Url.port = 80 then "" else Printf.sprintf ":%d" old_url.Url.port)
                     !url
               in
-              if !verbose then lprintf_nl () "Redirected to %s" url;
+              if !verbose then lprintf_nl "Redirected to %s" url;
               r.req_url <- (Url.of_string url);
               let r = { r with
       req_url = Url.of_string url;
@@ -320,46 +321,46 @@
         get_page r content_handler f
             
             with e ->
-                lprintf_nl () "error understanding redirect response %d" ans_code;
+                lprintf_nl "error understanding redirect response %d" ans_code;
                 print_headers ();
                 raise Not_found
                 
           end
         else 
-          lprintf_nl () "more than %d redirections, aborting." r.req_max_retry;
+          lprintf_nl "more than %d redirections, aborting." r.req_max_retry;
           raise Not_found
           
     | 404 ->
-        lprintf_nl () "404: Not found for: %s" (Url.to_string_no_args r.req_url);
+        lprintf_nl "404: Not found for: %s" (Url.to_string_no_args r.req_url);
         close sock (Closed_for_error "bad reply");
         raise Not_found
 
     | 502 | 503 | 504 ->
-        if !verbose then lprintf_nl () "%d: Unavailable" ans_code;
+        if !verbose then lprintf_nl "%d: Unavailable" ans_code;
   let retrynum = r.req_retry in
         if retrynum < r.req_max_retry then
           begin
             if !verbose then
               print_headers ();
       let seconds = (retrynum+1)*10 in
-              lprintf_nl () "retry %d/%d in %d seconds for %s"
+              lprintf_nl "retry %d/%d in %d seconds for %s"
           (retrynum+1) r.req_max_retry seconds (Url.to_string_no_args r.req_url);
       let r = { r with req_retry = retrynum+1 } in
         add_timer (float(seconds)) (fun t -> get_page r content_handler f)
     end
         else 
-          lprintf_nl () "more than %d retries, aborting." r.req_max_retry;
+          lprintf_nl "more than %d retries, aborting." r.req_max_retry;
           raise Not_found
           
     | _ ->
-        lprintf_nl () "%d: bad reply for: %s"
+        lprintf_nl "%d: bad reply for: %s"
           ans_code (Url.to_string_no_args r.req_url);
         close sock (Closed_for_error "bad reply");
         raise Not_found
   in
   get_url 0 r;
   if !error = true then begin
-      lprintf_nl () "failed!";
+      lprintf_nl "failed!";
       raise Not_found
     end
   
@@ -390,7 +391,7 @@
   (fun _ ->  
       let s = Buffer.contents file_buf in
       if s = "" then begin
-          lprintf_nl () "Empty content for url %s"
+          lprintf_nl "Empty content for url %s"
             (Url.to_string r.req_url);
       end;
       
@@ -409,7 +410,7 @@
       in
 
       let filename = Filename.concat webinfos_dir base in
-      if !verbose then lprintf_nl () "Filename: %s" filename;
+      if !verbose then lprintf_nl "Filename: %s" filename;
       Unix2.tryopen_write_bin filename (fun oc -> output_string oc s);
       if r.req_save_to_file_time <> 0. then
         Unix.utimes filename r.req_save_to_file_time r.req_save_to_file_time;
@@ -417,12 +418,12 @@
         (f filename : unit);
         if not r.req_save then Sys.remove filename
       with e ->  
-        lprintf_nl () "Exception %s in loading downloaded file %s" (Printexc2.to_string e) filename;
+        lprintf_nl "Exception %s in loading downloaded file %s" (Printexc2.to_string e) filename;
         Sys.remove filename;
         raise Not_found
   )
   with e -> 
-    lprintf_nl () "Exception %s in wget" (Printexc2.to_string e); 
+    lprintf_nl "Exception %s in wget" (Printexc2.to_string e); 
     raise Not_found
 
 let whead r f = 
@@ -486,5 +487,5 @@
           String.sub s (pos+1) (len-pos-1), key
     ) headers
   with e ->
-      lprintf_nl () "Exception in cut_headers: %s" (Printexc2.to_string e);
+      lprintf_nl "Exception in cut_headers: %s" (Printexc2.to_string e);
       raise e
Index: src/utils/net/http_server.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/http_server.ml,v
retrieving revision 1.28
diff -u -u -w -r1.28 http_server.ml
--- src/utils/net/http_server.ml	29 Mar 2006 15:41:33 -0000	1.28
+++ src/utils/net/http_server.ml	19 May 2006 21:58:36 -0000
@@ -23,9 +23,10 @@
 
 let verbose = ref false
 
-let lprintf_http_nl () =
-  lprintf "%s[HTTPsv] "
-  (log_time ()); lprintf_nl2
+let log_prefix = "[HTTPsv]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
 
 let html_escaped s =
   String2.convert false (fun b escaped c ->
@@ -261,7 +262,7 @@
               | _ -> options
             with e ->
                 if !debug then
-                    lprintf_http_nl () "Exception %s in header %s"
+                    lprintf_nl "Exception %s in header %s"
                       (Printexc2.to_string e) name;
                 options
 
@@ -786,7 +787,7 @@
   try
     iter new_pos
   with e ->
-      if !verbose then lprintf_http_nl () "Exception %s in request_handler"
+      if !verbose then lprintf_nl "Exception %s in request_handler"
         (Printexc2.to_string e);
       close sock (Closed_for_exception e)
 
@@ -805,7 +806,7 @@
         (match !Ip.banned from_ip with
            None -> true
          | Some reason ->
-             lprintf_http_nl () "%s:%d blocked: %s\n"
+             lprintf_nl "%s:%d blocked: %s\n"
                (Ip.to_string from_ip) from_port reason;
              false) then
         let token = create_token unlimited_connection_manager in
@@ -816,9 +817,9 @@
         TcpBufferedSocket.set_closer sock request_closer;
         TcpBufferedSocket.set_handler sock TcpBufferedSocket.BUFFER_OVERFLOW
           (fun _ -> TcpBufferedSocket.close sock Closed_for_overflow;
-	       lprintf_http_nl () "BUFFER OVERFLOW" );  ()
+         lprintf_nl "BUFFER OVERFLOW" );  ()
       else begin
-         lprintf_http_nl () "connection from %s rejected (see allowed_ips setting)"
+         lprintf_nl "connection from %s rejected (see allowed_ips setting)"
           (Ip.to_string from_ip);
         Unix.close s
       end
@@ -876,7 +877,7 @@
     x, Some y, Some z
   with
   | e ->
-      lprintf_http_nl () "Exception %s for range [%s]"
+      lprintf_nl "Exception %s for range [%s]"
         (Printexc2.to_string e) range;
       raise e
 
@@ -894,7 +895,7 @@
 (*  Range: bytes=31371876- *)
 let request_range r =
   if !verbose then List.iter (fun (h, v1) ->
-      lprintf_http_nl () "HEADER [%s] = [%s]" h v1
+      lprintf_nl "HEADER [%s] = [%s]" h v1
   ) r.headers;
   let range = List.assoc "Range" r.headers in
   match parse_range range with
Index: src/utils/net/ip_set.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/ip_set.ml,v
retrieving revision 1.26
diff -u -u -w -r1.26 ip_set.ml
--- src/utils/net/ip_set.ml	3 Apr 2006 20:50:09 -0000	1.26
+++ src/utils/net/ip_set.ml	19 May 2006 21:58:36 -0000
@@ -3,14 +3,14 @@
 open Ip
 
 (* prints a new logline with date, module and starts newline *)
-let lprintf_nl () =
-  lprintf "%s[IPblock] "
-  (log_time ()); lprintf_nl2
+let log_prefix = "[IPblock]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
 
 (* prints a new logline with date, module and does not start newline *)
-let lprintf_n () =
-  lprintf "%s[IPblock] "
-  (log_time ()); lprintf
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 module H = Weak.Make(struct
 	type t = string
@@ -206,7 +206,7 @@
 	with _ ->
 	  if not !error then
 	    begin
-	      lprintf_n () "Syntax error while loading IP blocklist in line";
+        lprintf_n "Syntax error while loading IP blocklist in line";
 	      error := true
 	    end;
 	    lprintf " %d" !nlines;
@@ -215,7 +215,7 @@
   if !error then lprint_newline ();
   if remove then (try Sys.remove filename with _ -> ());
   let optimized_bl = bl_optimize !bl in
-  lprintf_nl () "%d ranges loaded - optimized to %d" !nranges (bl_length optimized_bl);
+  lprintf_nl "%d ranges loaded - optimized to %d" !nranges (bl_length optimized_bl);
 (*    bl_optimizedp optimized_bl;
     for i=0 to 999999 do
       let random_ip = Ip.of_ints (Random.int 256, Random.int 256, Random.int 256, Random.int 256) in
@@ -227,7 +227,7 @@
   optimized_bl
 
 let load filename =
-  lprintf_nl () "loading %s" filename;
+  lprintf_nl "loading %s" filename;
   if Sys.file_exists filename then
     let last_ext = String.lowercase (Filename2.last_extension filename) in
     if last_ext = ".zip" then
@@ -242,21 +242,21 @@
 		| h :: q ->
 		    try
 		      let file = Zip.find_entry ic h in
-		      lprintf_nl () "%s found in zip file" h;
+          lprintf_nl "%s found in zip file" h;
 		      ignore(Misc.archive_extract filename "zip");
 		      load_merge bl_empty file.Zip.filename true
 		    with Not_found ->
 		      find_in_zip q in
 	    find_in_zip filenames_list
 	  with e ->
-	    lprintf_nl () "Exception %s while extracting %s from %s"
+      lprintf_nl "Exception %s while extracting %s from %s"
 	      (Printexc2.to_string e) 
 	      (String.concat "/" filenames_list)
 	      filename;
-	    lprintf_nl () "One of the mentioned files has to be present in the zip file";
+      lprintf_nl "One of the mentioned files has to be present in the zip file";
 	    bl_empty)
       with e ->
-	lprintf_nl () "Exception %s while opening %s"
+  lprintf_nl "Exception %s while opening %s"
 	  (Printexc2.to_string e)
 	  filename;
 	bl_empty)
@@ -271,17 +271,17 @@
 	      let s = Misc.archive_extract filename filetype in
 	      load_merge bl_empty s true
 	    with e ->
-	      lprintf_nl () "Exception %s while extracting from %s"
+        lprintf_nl "Exception %s while extracting from %s"
 		(Printexc2.to_string e) filename;
 	      bl_empty)
         | ".tar.bz2" | ".p2p.tar.bz2" | ".dat.tar.bz2"
         | ".tar.gz" | ".p2p.tar.gz" | ".dat.tar.gz" ->
-	    lprintf_nl () "tar files are not (yet) supported, please untar %s" filename;
+      lprintf_nl "tar files are not (yet) supported, please untar %s" filename;
 	    bl_empty
         | _ -> load_merge bl_empty filename false
   else
     begin
-      lprintf_nl () "file %s not found" filename;
+      lprintf_nl "file %s not found" filename;
       bl_empty
     end
 
