DFTK.jl
DFTK.jl copied to clipboard
Use Logging
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.
On that note I also thought about integrating with TimerOutputs.jl, which is kind of an optional light-weight profiling.
I'm quite happy with the default profiler for fine-grained stuff, but for more coarse-grained things it might be good