trixi-framework / Trixi.jl

Trixi.jl: Adaptive high-order numerical simulations of conservation laws in Julia
https://trixi-framework.github.io/Trixi.jl
MIT License
535 stars 109 forks source link

Implement logging mechanism #4

Open ranocha opened 4 years ago

ranocha commented 4 years ago

In GitLab by @sloede on Mar 14, 2020, 12:25

Store all regular output plus additional debug information in a log file such that it can be recovered later, e.g., in out/trixi_YYYMMDDHHmmss.log

The logging mechanism of Julia (https://docs.julialang.org/en/v1/stdlib/Logging/) should be used. The idea is the following (roughly as discussed with Gregor):

It might be interesting to enable other default output if logging-to-file is enabled, e.g., to copy the parameters file used to the beginning of the log file, or some information on when and where and with which command line arguments trixi was started.

Potential use cases where it might be interesting to have a permanent log:

ranocha commented 4 years ago

In GitLab by @sloede on Mar 18, 2020, 12:56

changed the description

ranocha commented 4 years ago

In GitLab by @sloede on Mar 24, 2020, 09:10

changed the description

ranocha commented 4 years ago

In GitLab by @sloede on May 13, 2020, 09:30

changed the description

efaulhaber commented 4 years ago

I am not sure what the proper way to implement logging in Trixi is. Obviously every println(...) will need to be replaced by an @info or @debug. But how should we control the logging level?

Should we explicitly provide a logger using

with_logger(logger) do
    [...]
end

somewhere in Trixi.run? Or should we rather use the default (global) logger and control logging levels with the environment variable?

ranocha commented 1 year ago

It would be nice to get this to be able to use https://github.com/JuliaLogging/LoggingExtras.jl

ranocha commented 5 months ago

A tee-like option may be Base.BufferStream, see https://discourse.julialang.org/t/write-to-file-and-stdout/35042/13

jlchan commented 5 months ago

Out of curiosity, what would this enable?

On Thu, May 23, 2024 at 12:36 PM Hendrik Ranocha @.***> wrote:

A tee-like option may be Base.BufferStream, see https://discourse.julialang.org/t/write-to-file-and-stdout/35042/13

— Reply to this email directly, view it on GitHub https://github.com/trixi-framework/Trixi.jl/issues/4#issuecomment-2127710073, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI2HUCUCPMS3ZU53WV6473ZDYSK7AVCNFSM4QDMFPLKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJSG43TCMBQG4ZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ranocha commented 5 months ago

Printing the output to a file and the screen - something several people have asked on Slack