nutofem / nuto

NuTo - yet another finite element library
https://nuto.readthedocs.io
Boost Software License 1.0
17 stars 5 forks source link

Pde global logging #240

Closed TTitscher closed 6 years ago

TTitscher commented 6 years ago

Add three global logger objects, accessible via

#include <nuto/base/Logger.h>

NuTo::Log::Info << "info stuff\n";
NuTo::Log::Debug << "debug stuff\n";
NuTo::Log::Error << "error stuff\n";

To identify the output coming from these loggers, a prefix is added. The above code will produce

Info|  info stuff
Debug| debug stuff
Error| error stuff

either on cout (controlled by ::SetQuiet(bool)) or in a file (controlled by ::OpenFile(string)). By default, debug is quiet.

codecov[bot] commented 6 years ago

Codecov Report

Merging #240 into PDE_reviewed will increase coverage by 0.2%. The diff coverage is 98.41%.

Impacted file tree graph

@@               Coverage Diff               @@
##           PDE_reviewed     #240     +/-   ##
===============================================
+ Coverage         89.86%   90.07%   +0.2%     
===============================================
  Files               329      330      +1     
  Lines             10871    10888     +17     
===============================================
+ Hits               9769     9807     +38     
+ Misses             1102     1081     -21
Flag Coverage Δ
#integrationtests 63.98% <86.95%> (+0.18%) :arrow_up:
#unittests 95.48% <92.45%> (-0.1%) :arrow_down:
Impacted Files Coverage Δ
nuto/mechanics/tools/AdaptiveSolve.h 100% <ø> (ø) :arrow_up:
nuto/mechanics/tools/QuasistaticSolver.h 100% <ø> (ø) :arrow_up:
nuto/mechanics/tools/QuasistaticSolver.cpp 91.22% <100%> (+1.06%) :arrow_up:
nuto/math/EigenSparseSolve.cpp 91.17% <100%> (+0.26%) :arrow_up:
nuto/mechanics/tools/AdaptiveSolve.cpp 96.55% <100%> (+4.24%) :arrow_up:
test/base/Logger.cpp 100% <100%> (ø)
nuto/base/Logger.h 100% <100%> (+18.18%) :arrow_up:
nuto/base/Logger.cpp 96.77% <96.55%> (+66.77%) :arrow_up:
nuto/base/Timer.cpp 88.46% <0%> (+11.53%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 94655fb...0b2ba16. Read the comment docs.

TTitscher commented 6 years ago

I find it quite handy to collect the log files in one place, e.g. the post processing directory. In my simulations, these directories are created at run time and I cannot redirect the output to this not-yet-existing directory.