Changes between Version 12 and Version 13 of CodingGuidelines


Ignore:
Timestamp:
Mar 29, 2012, 10:42:21 AM (13 years ago)
Author:
FrederikHeber
Comment:

Added section on using the logger

Legend:

Unmodified
Added
Removed
Modified
  • CodingGuidelines

    v12 v13  
    146146
    147147Although in general, we do not want to rely to heavily on other libraries (because of licenses), do not reimplement the wheel if what you need is found in STL or [http://www.boost.org/ boost] which both are (quasi) standards.
     148
     149=== Use the logger, not cout/cerr === #code-good-bad-logger
     150
     151__Don't use__ '''std::cout''' or '''std::cerr''' (except maybe for internal tests which never make it into a commit).
     152
     153__Always use__
     154{{{
     155#include "CodePatterns/Log.hpp"
     156
     157  ...
     158  LOG(1, "INFO: Variable bla contains " << bla << ".");
     159  ...
     160  ELOG(1, "Variable is " << bla << " which is invalid!");
     161  ...
     162}}}
     163
     164This way we can control the verbosity of the code easily and we do not end up with many commented-out wasteland alike ''... //std::cout << "Variable bla is " << ...''.