DFTK.jl icon indicating copy to clipboard operation
DFTK.jl copied to clipboard

Use Logging

Open antoine-levitt opened this issue 6 years ago • 2 comments

The Logging stdlib is very nicely done. The main design point is separating production of log messages from processing : we can define several log levels, and then decide what we want to do with them - ignore some, print some, write some to an output file, etc. In particular we can just pepper the code liberally with @info and @debug (or similar) and worry later about if we want to display it or not. Added benefit is we can disable some and the corresponding macro will not get evaluated, which might be a way to do expensive checks.

antoine-levitt avatar Nov 12 '19 07:11 antoine-levitt

On that note I also thought about integrating with TimerOutputs.jl, which is kind of an optional light-weight profiling.

mfherbst avatar Nov 12 '19 08:11 mfherbst

I'm quite happy with the default profiler for fine-grained stuff, but for more coarse-grained things it might be good

antoine-levitt avatar Nov 12 '19 08:11 antoine-levitt