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).
No description
11 Replies
JavaBot
JavaBot10mo ago
This post has been reserved for your question.
Hey @Steadhaven! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Steadhaven
SteadhavenOP10mo ago
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 Logger
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Steadhaven
SteadhavenOP10mo ago
Ok smart thanks:)
Steadhaven
SteadhavenOP10mo ago
Apparently you can do System.out.flush() to get the white messages before
No description
Steadhaven
SteadhavenOP10mo ago
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
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Steadhaven
SteadhavenOP10mo ago
Oooh thats probably what I saw in an algo/datastructure course
No description
JavaBot
JavaBot10mo ago
💤 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.

Did you find this page helpful?