From 6dfd9bca696d5de1f54e27227df7a648d9139c6b Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sat, 4 Dec 2010 18:48:01 +0000
Subject: [PATCH] log tweaks

---
 core/java/src/net/i2p/util/I2PThread.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/java/src/net/i2p/util/I2PThread.java b/core/java/src/net/i2p/util/I2PThread.java
index c21c66f6be..9b76b8fc9c 100644
--- a/core/java/src/net/i2p/util/I2PThread.java
+++ b/core/java/src/net/i2p/util/I2PThread.java
@@ -61,8 +61,8 @@ public class I2PThread extends Thread {
             _createdBy = new Exception("Created by");
     }
 
-    private void log(int level, String msg) { log(level, msg, null); }
-    private void log(int level, String msg, Throwable t) {
+    private static void log(int level, String msg) { log(level, msg, null); }
+    private static void log(int level, String msg, Throwable t) {
         // we cant assume log is created
         if (_log == null) _log = new Log(I2PThread.class);
         if (_log.shouldLog(level))
@@ -72,12 +72,12 @@ public class I2PThread extends Thread {
     @Override
     public void run() {
         _name = Thread.currentThread().getName();
-        log(Log.DEBUG, "New thread started: " + _name, _createdBy);
+        log(Log.INFO, "New thread started" + (isDaemon() ? " (daemon): " : ": ") + _name, _createdBy);
         try {
             super.run();
         } catch (Throwable t) {
             try {
-                log(Log.CRIT, "Killing thread " + getName(), t);
+                log(Log.CRIT, "Thread terminated unexpectedly: " + getName(), t);
             } catch (Throwable woof) {
                 System.err.println("Died within the OOM itself");
                 t.printStackTrace();
@@ -85,12 +85,12 @@ public class I2PThread extends Thread {
             if (t instanceof OutOfMemoryError)
                 fireOOM((OutOfMemoryError)t);
         }
-        log(Log.DEBUG, "Thread finished gracefully: " + _name);
+        log(Log.INFO, "Thread finished normally: " + _name);
     }
     
     @Override
     protected void finalize() throws Throwable {
-        log(Log.DEBUG, "Thread finalized: " + _name);
+        //log(Log.DEBUG, "Thread finalized: " + _name);
         super.finalize();
     }
     
-- 
GitLab