Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,6 @@ class Time { | |
sys_time_t t; | ||
}; | ||
|
||
extern void logger_set(bool b); | ||
|
||
#endif // !defined(MISC_H_INCLUDED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eb28a68
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using "o" as a parameter with the on_xxx(const UICOption& o) functions is a bit dangerous because of confusion with "0". Why not replace it with "opt" or "option"?
eb28a68
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.