]> git.sesse.net Git - stockfish/commit
Add (smart) logging facility
authorMarco Costalba <mcostalba@gmail.com>
Sun, 18 Mar 2012 02:20:43 +0000 (03:20 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 18 Mar 2012 22:10:24 +0000 (23:10 +0100)
commiteb28a683bd5a15be4a59c1e14b45b2c80cf7bf2c
tree9d204eef872a634ed75f3b91ce3a991d47cb956d
parent2dfc94e0b6e011b0eb769fa0f0fcf9f2c4a2987b
Add (smart) logging facility

By means of "Use Debug Log" UCI option it is possible to toggle
the logging of std::cout to file "out.txt" while preserving
the usual output to stdout. There is zero overhead when logging
is disabled and we achieved this without changing a single line
of exsisting code, in particular we still use std::cout as usual.

The idea and part of the code comes from this article:
http://groups.google.com/group/comp.lang.c++/msg/1d941c0f26ea0d81

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/misc.cpp
src/misc.h
src/ucioption.cpp