# Any way to remove "From worker"?

**URL:** <https://discourse.julialang.org/t/any-way-to-remove-from-worker/23604>\
**Category:** General Usage\
**Created:** [April 27, 2019, 5:51pm UTC](https://discourse.julialang.org/t/any-way-to-remove-from-worker/23604 "2019-04-27T17:51:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [April 27, 2019, 5:51pm UTC](https://discourse.julialang.org/t/any-way-to-remove-from-worker/23604/1 "2019-04-27T17:51:15Z")

</div>

I want to print some data in a distributed for-loop but I don’t really want to see these lines with the “from worker” prefix. Is there any way to get rid of it?

```julia
      From worker 3:	hello
      From worker 4:	world
      From worker 2:	foo

```

---

<div class="post-metadata">

**Author:** ![TsurHerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tsurherman/32/1234_2.png) [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Post date:** [April 28, 2019, 7:04am UTC](https://discourse.julialang.org/t/any-way-to-remove-from-worker/23604/2 "2019-04-28T07:04:29Z")

</div>

you could overwrite the redirected printing function from distributed and omit the “from worker”

```julia
using Distributed

Distributed.redirect_worker_output(ident, stream) = begin
    @async while !eof(stream)
        line = readline(stream)
        if startswith(line, " From worker ")
            # stdout's of "additional" workers started from an initial worker on a host are not available
            # on the master directly - they are routed via the initial worker's stdout.
            parts = split(line,":")
            println(join(parts[2:end]...))
        else
            # println(" From worker $(ident):\t$line")
            println(line)
        end
    end
end
addprocs(1)

@spawn println("hello")

```

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [May 8, 2019, 6:03am UTC](https://discourse.julialang.org/t/any-way-to-remove-from-worker/23604/3 "2019-05-08T06:03:48Z")

</div>

I do something similar in a multi-core application I have:

```julia
Core.eval(Distributed, :(function redirect_worker_output(ident, stream)
        @async while !eof(stream)
            println(readline(stream))
        end
    end))

```
