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

**URL:** https://discourse.julialang.org/t/issues-with-println-buffering-output-when-redirecting-stdout-to-a-txt-file/23738
**Category:** General Usage
**Created:** [May 1, 2019, 3:12pm UTC](https://discourse.julialang.org/t/issues-with-println-buffering-output-when-redirecting-stdout-to-a-txt-file/23738 "2019-05-01T15:12:45Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [May 1, 2019, 3:48pm UTC](https://discourse.julialang.org/t/issues-with-println-buffering-output-when-redirecting-stdout-to-a-txt-file/23738/3 "2019-05-01T15:48:31Z")

</div>

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:

> [@Avoiding very long output](https://discourse.julialang.org/t/avoiding-very-long-output/23658):
>
> Occasionally, for custom types, I forget to define a show method that respects limit. This can happen accidentally even with the best intentions, eg with unfortunate combinations of nested types. This can lead to very long output in the REPL, which not all terminals and interfaces are happy with. I am wondering it it would be possible to somehow customize the REPL or the display infrastructure to catch this. Eg when working the REPL, somehow impose a sanity check of cutting off at eg line 100,…

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:

> **[GitHub - KristofferC/IOIndents.jl: Simple writing of indented and aligned text](https://github.com/KristofferC/IOIndents.jl)**
>
> Simple writing of indented and aligned text. Contribute to KristofferC/IOIndents.jl development by creating an account on GitHub.

---

_[View the full topic](https://discourse.julialang.org/t/issues-with-println-buffering-output-when-redirecting-stdout-to-a-txt-file/23738)._
