Skip to content

Commit 02e1e1f

Browse files
committed
reduce logs
1 parent 6e1500f commit 02e1e1f

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/threads/TaskExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void uncaughtException(Thread t, Throwable e) {
105105

106106
/** Describe what this executor is doing for debugging purpose. */
107107
public void debug(StringBuilder s, String type) {
108-
s.append("\r\n - ").append(type).append(' ').append(thread.getName()).append(": ");
108+
s.append("\n - ").append(type).append(' ').append(thread.getName()).append(": ");
109109
Task<?,?> c = currentTask;
110110
if (c == null)
111111
s.append("waiting");

net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/threads/TaskManager.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,7 @@ public final void debug(StringBuilder s) {
302302
getDebugDescription(s);
303303
for (TaskExecutor w : getActiveExecutors())
304304
w.debug(s, "Active");
305-
for (TaskExecutor w : getInactiveExecutors())
306-
try { w.debug(s, "Inactive"); }
307-
catch (Exception t) { /* ignore, because we don't want to do it in a synchronized block, so NPE can happen */ }
305+
s.append("\n - ").append(getInactiveExecutors().size()).append(" thread(s) inactive");
308306
for (TaskExecutor w : blocked)
309307
try { w.debug(s, "Blocked"); }
310308
catch (Exception t) { /* ignore, because we don't want to do it in a synchronized block, so NPE can happen */ }

net.lecousin.core/src/test/java/net/lecousin/framework/core/test/serialization/TestSerialization.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@
4949
import net.lecousin.framework.io.serialization.annotations.TypeInstantiation;
5050
import net.lecousin.framework.io.serialization.annotations.TypeSerializationMethod;
5151
import net.lecousin.framework.io.serialization.annotations.TypeSerializer;
52+
import net.lecousin.framework.log.Logger;
53+
import net.lecousin.framework.log.LoggerFactory;
5254
import net.lecousin.framework.math.IntegerUnit.Unit;
55+
import net.lecousin.framework.math.TimeUnit;
5356
import net.lecousin.framework.text.CharArrayString;
5457
import net.lecousin.framework.text.CharArrayStringBuffer;
55-
import net.lecousin.framework.math.TimeUnit;
5658
import net.lecousin.framework.util.ClassUtil;
5759
import net.lecousin.framework.util.Factory;
5860
import net.lecousin.framework.util.Pair;
@@ -66,6 +68,8 @@ public abstract class TestSerialization extends LCCoreAbstractTest {
6668
protected abstract Deserializer createDeserializer();
6769
protected abstract SerializationSpecWriter createSpecWriter();
6870

71+
protected Logger logger = LoggerFactory.get(TestSerialization.class);
72+
6973
@Test
7074
public void testBasics() {
7175
Deserializer des = createDeserializer();
@@ -1269,14 +1273,14 @@ protected void checkIO(IO.Readable.Seekable io1, IO.Readable io2) throws Excepti
12691273
protected void print(IO.Readable.Seekable io, Object o) throws Exception {
12701274
String content = IOUtil.readFullyAsStringSync(io, StandardCharsets.UTF_8);
12711275
io.seekSync(SeekType.FROM_BEGINNING, 0);
1272-
System.out.println("Serialization result for " + (o == null ? "null" : o.getClass().getName()) + "\r\n" + content);
1276+
logger.trace("Serialization result for " + (o == null ? "null" : o.getClass().getName()) + "\r\n" + content);
12731277
}
12741278

12751279
protected void printSpec(IO.Readable.Seekable io, Class<?> type) throws Exception {
12761280
io.seekSync(SeekType.FROM_BEGINNING, 0);
12771281
String content = IOUtil.readFullyAsStringSync(io, StandardCharsets.UTF_8);
12781282
io.seekSync(SeekType.FROM_BEGINNING, 0);
1279-
System.out.println("Serialization specification for " + type.getName() + "\r\n" + content);
1283+
logger.trace("Serialization specification for " + type.getName() + "\r\n" + content);
12801284
}
12811285

12821286
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)