commit 1d7691bba248f2d0a1fb4cc8053f6f8a18388853 Author: Karsten Loesing karsten.loesing@gmx.net Date: Wed Nov 20 12:46:22 2019 +0100
Fix logging bugs. --- src/main/java/org/torproject/metrics/stats/main/Main.java | 3 ++- src/main/java/org/torproject/metrics/web/UpdateNews.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/torproject/metrics/stats/main/Main.java b/src/main/java/org/torproject/metrics/stats/main/Main.java index 3dc2775..1dec6a3 100644 --- a/src/main/java/org/torproject/metrics/stats/main/Main.java +++ b/src/main/java/org/torproject/metrics/stats/main/Main.java @@ -68,7 +68,8 @@ public class Main { } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { log.warn("Caught an exception when invoking the main method of the {} " - + "module. Moving on to the next module, if available.", e); + + "module. Moving on to the next module, if available.", + module.getName(), e); } }
diff --git a/src/main/java/org/torproject/metrics/web/UpdateNews.java b/src/main/java/org/torproject/metrics/web/UpdateNews.java index abce4f1..92103fe 100644 --- a/src/main/java/org/torproject/metrics/web/UpdateNews.java +++ b/src/main/java/org/torproject/metrics/web/UpdateNews.java @@ -77,7 +77,7 @@ public class UpdateNews { int space = desc.indexOf(" ", open); int close = desc.indexOf("]", open); if (open < 0 || space < 0 || close < 0) { - log.warn("Cannot convert link in line {}. Exiting."); + log.warn("Cannot convert link in line {}. Exiting.", line); System.exit(1); } desc = desc.substring(0, open) + "<a href="" @@ -89,7 +89,7 @@ public class UpdateNews { int open = desc.indexOf("`"); int close = desc.indexOf("`", open + 1); if (open < 0 || close < 0) { - log.warn("Cannot convert code fragment in line {}. Exiting."); + log.warn("Cannot convert code fragment in line {}. Exiting.", line); System.exit(1); } desc = desc.substring(0, open) + "<code>"
tor-commits@lists.torproject.org