# Debugging: @info display format

**URL:** https://discourse.julialang.org/t/debugging-info-display-format/21369
**Category:** New to Julia
**Tags:** debug
**Created:** [March 1, 2019, 9:19pm UTC](https://discourse.julialang.org/t/debugging-info-display-format/21369 "2019-03-01T21:19:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jacob-roth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacob-roth/32/1862_2.png) [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)
#### Post date: [March 1, 2019, 9:19pm UTC](https://discourse.julialang.org/t/debugging-info-display-format/21369/1 "2019-03-01T21:19:23Z")

</div>

I’m trying to get familiar with `Logging` and am curious about best practices for displaying output. I have a function `test` which does some operations on a matrix, and I want to see the matrix after some operations.

```julia
function test(A::AbstractArray)
    A = A' * A
    @info "A" Diagonal(Matrix(A))
end

```

From the REPL, I do

```julia
julia> A = randn(3,3)
3×3 Array{Float64,2}:
 -1.3463 0.37979 0.116741
  0.448312 -0.778678 -0.276227
  0.0663637 -1.65814 0.306757

julia> @info "diag(A)" Diagonal(Matrix(A))
┌ Info: diag(A)
│ Diagonal(Matrix(A)) =
│ 3×3 Diagonal{Float64,Array{Float64,1}}:
│ -1.3463 ⋅ ⋅
│ ⋅ -0.778678 ⋅
└ ⋅ ⋅ 0.306757

```

and the `@info` message is formatted nicely. However, when I set up a logger and call `test`, it’s not as nice:

```julia
julia> logger=Logging.SimpleLogger(stdout, Logging.Debug)
julia> Logging.with_logger(logger) do; test(A); end
┌ Info: A
│ Diagonal(Matrix(A)) = [2.0179 0.0 0.0; 0.0 3.5 0.0; 0.0 0.0 0.184029]
└ @ Main REPL[30]:3

```

I tried to `display` the diagonal, but that didn’t work either. What am I missing about displaying at REPL vs inside a function?

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [March 1, 2019, 9:33pm UTC](https://discourse.julialang.org/t/debugging-info-display-format/21369/2 "2019-03-01T21:33:48Z")

</div>

The default logger in the REPL is `ConsoleLogger`, not `SimpleLogger`.
