Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace System.out and System.err with logging #25

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

denizt
Copy link
Collaborator

@denizt denizt commented Feb 24, 2024

These series of commits removes all System.out and System.err from the code replacing in with java.util.logging, except from examples and tests

There are also some atomic commits that removes dead/unused code.

@denizt denizt changed the title Replace system.out and System.err with logging Replace System.out and System.err with logging Feb 24, 2024
@denizt denizt requested a review from lucav76 February 24, 2024 10:02
src/main/java/eu/lucaventuri/common/Exceptions.java Outdated Show resolved Hide resolved
src/main/java/eu/lucaventuri/common/SystemUtils.java Outdated Show resolved Hide resolved
@@ -253,14 +254,14 @@ public static long transferStream(InputStream is, OutputStream os, String echoLa
while ((read = is.read(buffer, 0, buffer.length)) >= 0) {
os.write(buffer, 0, read);
if (echoLabel != null && transferred < 128)
System.out.println(echoLabel + ": " + new String(buffer, 0, (int) Math.min(read - transferred, 128)));
logger.log(Level.FINE, echoLabel + ": " + new String(buffer, 0, (int) Math.min(read - transferred, 128)));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not intended as log, please leave the println

src/main/java/eu/lucaventuri/fibry/ActorSystem.java Outdated Show resolved Hide resolved
src/main/java/eu/lucaventuri/fibry/BaseActor.java Outdated Show resolved Hide resolved
Methods suffixed with short no longer log the stack trace. We also
bump the level to INFO which is default, unless overriden by a
config file.

Silent methods now log the exceptions with the stack trace only
for FINEST level.
Also add a FINEST level of logging for caught exceptions.
Add it as an extracted method and comment out the call instead.
@denizt denizt requested a review from lucav76 February 25, 2024 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants