mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-24 18:06:42 +02:00
- Instrumented version for shadow file testing.
This commit is contained in:
parent
b4b389c27e
commit
ce561a6c43
3 changed files with 11 additions and 2 deletions
|
@ -679,10 +679,12 @@ void updateRecurrenceMask (
|
|||
// Using gTdb and gConf, generate a report.
|
||||
void onChangeCallback ()
|
||||
{
|
||||
std::cout << "--- callback" << std::endl;
|
||||
try
|
||||
{
|
||||
if (gConf && gTdb)
|
||||
{
|
||||
std::cout << "--- valid globals" << std::endl;
|
||||
gConf->set ("curses", "off");
|
||||
gConf->set ("color", "off");
|
||||
|
||||
|
@ -690,6 +692,7 @@ void onChangeCallback ()
|
|||
std::string shadowFile = expandPath (gConf->get ("shadow.file"));
|
||||
if (shadowFile != "")
|
||||
{
|
||||
std::cout << "--- shadowFile " << shadowFile<< std::endl;
|
||||
// Capture std::cout for the shadow file.
|
||||
std::ofstream shadow (shadowFile.c_str ());
|
||||
std::streambuf* original = std::cout.rdbuf (shadow.rdbuf ());
|
||||
|
@ -704,6 +707,8 @@ void onChangeCallback ()
|
|||
|
||||
// Restore std::cout.
|
||||
std::cout.rdbuf (original);
|
||||
shadow.close ();
|
||||
std::cout << "--- Complete " << std::endl;
|
||||
}
|
||||
else
|
||||
throw std::string ("Could not write to '") + shadowFile + "'.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue