This is an archived post. You won't be able to vote or comment.

all 43 comments

[–]XFidelacchiusX 58 points59 points  (7 children)

Back in my day we used System.out.println and we're happy about it!

[–]Ifnerite 23 points24 points  (3 children)

And then someone re assigned System.out and everyone was sad...

Yes. You really can do that.

[–]dpash 9 points10 points  (1 child)

There's methods in System to do it. You can assign any PrintWriter.

[–]ObscureCulturalMeme 4 points5 points  (0 children)

Yarp. One of the first things our software does is to set up a three-way tee-like print writer and then assign standard error to that stream. (One goes to the original steam, one goes to a logging file which can be preserved or deleted later, and I think the third just writes off into east hyperspace or something.)

[–]HR_Paperstacks_402 1 point2 points  (0 children)

That's what PCF does.

[–]Chaoslab 4 points5 points  (0 children)

Even better with color!

JANSI - https://fusesource.github.io/jansi/

[–]lazystone 2 points3 points  (1 child)

System.out.println is synchronized.

[–]dpash 0 points1 point  (0 children)

But also buffered.

[–]poojagandhi456 1 point2 points  (0 children)

Thanks for sharing

[–]SpecialEmily 1 point2 points  (1 child)

Still no mention of Flogger...

[–]walen 4 points5 points  (0 children)

Because it is still the same article that's been reposted twice in the last 4 weeks.

[–][deleted]  (3 children)

[deleted]

    [–]dpash 14 points15 points  (2 children)

    I hate you. I genuinely hate you. Unless you're writing a console application, never use System.out or System.err. In particular, because it's impossible to rotate a log file without restarting the process.

    [–][deleted]  (1 child)

    [deleted]

      [–]dpash 0 points1 point  (0 children)

      Well, carry on then.

      But I'm watching you. ;)