Skip to content

Commit 10b9f93

Browse files
committed
improve error logging with file paths and context
1 parent 3b6756b commit 10b9f93

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

concore.hpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,9 @@ class Concore{
320320
throw 505;
321321
}
322322
}
323-
//observed retry count in C++ from various tests is approx 80.
324323
catch(...){
325-
cout<<"Read error";
324+
cerr << "Error reading " << inpath << port << "/" << name << " (retry " << retrycount << ")" << endl;
326325
}
327-
328-
329326
}
330327
s += ins;
331328

@@ -381,9 +378,8 @@ class Concore{
381378
throw 505;
382379
}
383380
}
384-
//observed retry count in C++ from various tests is approx 80.
385381
catch(...){
386-
std::cout << "Read error" << std::endl;
382+
cerr << "Error reading from shared memory port " << port << " name " << name << " (retry " << retrycount << ")" << endl;
387383
}
388384
}
389385
s += ins;
@@ -458,7 +454,7 @@ class Concore{
458454
}
459455

460456
catch(...){
461-
cout<<"skipping +"<<outpath<<port<<" /"<<name;
457+
cerr << "Error writing to " << outpath << port << "/" << name << endl;
462458
}
463459
}
464460

@@ -483,7 +479,7 @@ class Concore{
483479
else throw 505;
484480
}
485481
catch(...){
486-
cout<<"skipping +"<<outpath<<port<<" /"<<name;
482+
cerr << "Error writing to " << outpath << port << "/" << name << endl;
487483
}
488484
}
489485

@@ -513,7 +509,7 @@ class Concore{
513509
}
514510

515511
catch(...){
516-
cout<<"skipping +"<<outpath<<port<<" /"<<name;
512+
cerr << "Error writing to shared memory port " << port << " name " << name << endl;
517513
}
518514
}
519515

@@ -534,7 +530,7 @@ class Concore{
534530
else throw 505;
535531
}
536532
catch(...){
537-
cout<<"skipping +"<<outpath<<port<<" /"<<name;
533+
cerr << "Error writing to shared memory port " << port << " name " << name << endl;
538534
}
539535
}
540536

0 commit comments

Comments
 (0)