# Tracing of optimization algorithm with @debug

**URL:** https://discourse.julialang.org/t/tracing-of-optimization-algorithm-with-debug/69184
**Category:** General Usage
**Tags:** question, debug
**Created:** [October 4, 2021, 11:32am UTC](https://discourse.julialang.org/t/tracing-of-optimization-algorithm-with-debug/69184 "2021-10-04T11:32:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![stepanzh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stepanzh/32/34851_2.png) [@stepanzh](https://discourse.julialang.org/u/stepanzh)
#### Post date: [October 4, 2021, 11:32am UTC](https://discourse.julialang.org/t/tracing-of-optimization-algorithm-with-debug/69184/1 "2021-10-04T11:32:26Z")

</div>

I’m debugging a constatined-optimization algorithm of [CubicEoS.jl](https://github.com/vvpisarev/CubicEoS.jl.git) package.

The code is heavily logged with `@debug` macro. Each of `@debug`-entry has a unique `message` like `newton` or `backtracking`…

**I want to post-process logs and make them tabular for further plotting of optimization trace.**

For example, I want to collect `newton`’s branch of `@debug` logs and convert them to a table. So, these messages

```julia
...
...
┌ Debug: newton
│ i = 1
│ f(x) = -0.000153587
│ norm(∇f(x)) = 0.072439363
└ @ CubicEoS ~/.julia/dev/CubicEoS/src/newton.jl:43
...
...
┌ Debug: newton
│ i = 2
│ f(x) = -0.000155484
│ norm(∇f(x)) = 0.056179837
└ @ CubicEoS ~/.julia/dev/CubicEoS/src/newton.jl:43
...
...

```

should be converted as (.csv, .tsv,…)

```julia
i f(x) norm(∇f(x))
1	-0.000153587 0.072439363
2	-0.000155484 0.056179837

```

**Is there a package for such purposes?**
