System.err shows up before System.out in terminal?
How come
System.err
(red error text) show up in the terminal before System.out
(white normal text) even though the error comes later in the code?
Its something about the System.err
getting "flashed" more quickly or something, whereas the System.out
might still be in the "buffer" (not sure what the buffer is, or even if "flashed" is the correct term).
11 Replies
⌛
This post has been reserved for your question.
Hey @Steadhaven! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
yea that was definitely the term :D thanks.
So System.err gets flushed quickly
so fast that System.out might still be in the buffer
(not sure what buffer is being referred to, as I only know that theres heap and stack memory)
So its possible to somehow tunnel all the
System.err
message into a LoggerUnknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Ok smart thanks:)
Apparently you can do
System.out.flush()
to get the white messages before
I think it force "flushes" the
System.out
messages from its "buffer" (still don't know what buffer its refering to, perhaps the stack or heap memory)Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Oooh thats probably what I saw in an algo/datastructure course

💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.