# Non-compact printing in logs in non-interactive sessions

**URL:** https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104
**Category:** General Usage
**Tags:** question
**Created:** [September 24, 2019, 10:37am UTC](https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104 "2019-09-24T10:37:43Z")
**Posts on this page:** 4
**Page:** 1

<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: [September 24, 2019, 10:37am UTC](https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104/1 "2019-09-24T10:37:43Z")

</div>

In a long-running process I need to write out occasional numeric data. I found that it is printed compactly. MWE:

```julia
tamas@tamas-vivobook ~/src/mu % julia -e 'x = collect(1.0:50.0); @info "logging" x'
┌ Info: logging
│ x =
│ 50-element Array{Float64,1}:
│ 1.0
│ 2.0
│ 3.0
│ 4.0
│ 5.0
│ 6.0
│ 7.0
│ 8.0
│ 9.0
│ 10.0
│ 11.0
│ 12.0
│ 13.0
│ ⋮  
│ 39.0
│ 40.0
│ 41.0
│ 42.0
│ 43.0
│ 44.0
│ 45.0
│ 46.0
│ 47.0
│ 48.0
│ 49.0
└ 50.0

```

What’s the simplest way to make `@info` print all the elements in

(If this cannot be done, I can always revert to `show`, so I know a workaround)

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [September 24, 2019, 10:43am UTC](https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104/2 "2019-09-24T10:43:28Z")

</div>

The `IOContext` is [hard-coded](https://github.com/JuliaLang/julia/blob/4f17558e4c71908e8ba40d24e37bdacd5e2f2e5e/stdlib/Logging/src/ConsoleLogger.jl#L113), so the best you can do is probably somethink like

```julia
julia> x = collect(1.0:50.0);

julia> @info "blah" sprint(show, x')
┌ Info: blah
└ sprint(show, x') = "[1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0
45.0 46.0 47.0 48.0 49.0 50.0]"

```

---

<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: [September 24, 2019, 10:44am UTC](https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104/3 "2019-09-24T10:44:06Z")

</div>

Thanks. Do you think it is worth opening an issue about this?

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [September 24, 2019, 10:46am UTC](https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104/4 "2019-09-24T10:46:23Z")

</div>

No, since I didn’t read the code correctly and the interesting value _isn’t_ hardcoded. So you can just do

```julia
julia> global_logger(ConsoleLogger(show_limited=false))
ConsoleLogger(Base.TTY(Base.Libc.WindowsRawSocket(0x00000000000002ac) open, 0 bytes waiting), Info, Logging.default_metafmt, true, 0, Dict{Any,Int64}())

julia> @info "blah" x'
┌ Info: blah
│ x' =
│ 1×50 LinearAlgebra.Adjoint{Float64,Array{Float64,1}}:
└ 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0
 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0

```
