Issues with println buffering output when redirecting stdout to a txt file

Regarding println: since it has multiple methods, you cannot find the definition. Eg methods(println) should list them all.

That said, overwriting a method in Base is almost surely not the way you want to do this. I asked a similar question a while ago, you may find the solution helpful:

Or, if this is not for display purposes, you can define a wrapper type for an <:IO that captures the \n, and flushes. This is a nice example of something similar: