Author: low012
Date: 2008-02-24 20:56:19 +0100 (Sun, 24 Feb 2008)
New Revision: 4505

Modified:
   trunk/source/de/anomic/tools/gzip.java
Log:
*) Replaced System.err.println() by logging function. Left 
System.err.println()s as comments to be able to quickly revert changes since 
gzip is an application with it's own main method and Orbiter maybe wants to 
keep it this way.

Modified: trunk/source/de/anomic/tools/gzip.java
===================================================================
--- trunk/source/de/anomic/tools/gzip.java      2008-02-24 12:58:32 UTC (rev 
4504)
+++ trunk/source/de/anomic/tools/gzip.java      2008-02-24 19:56:19 UTC (rev 
4505)
@@ -53,8 +53,12 @@
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 
+import de.anomic.server.logging.serverLog;
+
 public class gzip {
 
+    private static serverLog logger = new serverLog("GZIP");
+    
     public static void gzipFile(String inFile, String outFile) {
        try {
            InputStream  fin  = new FileInputStream(inFile);
@@ -63,9 +67,11 @@
            fin.close();
            fout.close();
        } catch (FileNotFoundException e) {
-           System.err.println("ERROR: file '" + inFile + "' not found");
+            //System.err.println("ERROR: file '" + inFile + "' not found");
+           logger.logWarning("ERROR: file '" + inFile + "' not found", e);
        } catch (IOException e) {
-           System.err.println("ERROR: IO trouble");
+            //System.err.println("ERROR: IO trouble ");
+            logger.logWarning("ERROR: IO trouble ",e);
        }
     }
 
@@ -77,9 +83,11 @@
            fin.close();
            fout.close();
        } catch (FileNotFoundException e) {
-           System.err.println("ERROR: file '" + inFile + "' not found");
+            //System.err.println("ERROR: file '" + inFile + "' not found");
+           logger.logWarning("ERROR: file '" + inFile + "' not found", e);
        } catch (IOException e) {
-           System.err.println("ERROR: IO trouble");
+            //System.err.println("ERROR: IO trouble ");
+            logger.logWarning("ERROR: IO trouble ",e);
        }
     }
 
@@ -93,7 +101,8 @@
            fout.close();
            return baos.toByteArray();
        } catch (IOException e) {
-           System.err.println("ERROR: IO trouble");
+            //System.err.println("ERROR: IO trouble ");
+           logger.logWarning("ERROR: IO trouble ",e);
            return null;
        }
     }
@@ -107,7 +116,8 @@
            fout.close();
            return new String(fout.toByteArray(), "UTF-8");
        } catch (IOException e) {
-           System.err.println("ERROR: IO trouble");
+            //System.err.println("ERROR: IO trouble ");
+           logger.logWarning("ERROR: IO trouble ",e);
            return null;
        }
     }

_______________________________________________
YaCy-svn mailing list
YaCy-svn@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/yacy-svn

Antwort per Email an