termi-official / Thunderbolt.jl

A modular shared-memory high-performance framework for multiscale cardiac multiphysics simulations.
MIT License
11 stars 1 forks source link

Add a logging framework #12

Open termi-official opened 8 months ago

termi-official commented 8 months ago

We should give better insights and control about what exactly is happening.

termi-official commented 1 month ago

Snippet for future reference

using ProgressMeter
function print_progress_bars()
    p0 = Progress(100; desc="Timestep", offset=0, dt=0.0)
    p1 = ProgressThresh(0.0001; desc="Nonlinear: ", offset=2, dt=0.0)
    p2 = ProgressThresh(0.00001; desc="Inner Linear: ", offset=4)
    for i in 1:100
        update!(p0, i, showvalues=[(:t, i/100)])
        update!(p1, 1.0/i, showvalues=[(:i, i*i)])
        update!(p2, 1.0/i, showvalues=[(:i, i,)])
        sleep(0.025)
    end
    print(p2.core.output, "\n" ^ (p2.offset + p2.numprintedvalues))
end