View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0022929 | Community | OCCT:Foundation Classes | public | 2012-01-26 22:36 | 2017-07-13 16:20 |
Reporter | Roman Lygin | Assigned To | bugmaster | ||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Product Version | 6.5.2 | ||||
Target Version | 7.2.0 | Fixed in Version | 6.8.0 | ||
Summary | 0022929: [Coding Rules] Eliminate debug output | ||||
Description | OCC should not contaminate output with own debug info. This is especially important for library solutions that are based on OCC. This should become part of the Coding Rules and part of the code review process. Details: OCC source code has numerous instances of debug output (e.g. using std::cerr or cout). Most often this is surrounded with #ifdef DEB (which is an OCC-specific macro instead of standard _DEBUG). Example STEPControl_ActorRead.cxx: #ifdef DEB cout << "//What is?// NB COMPOUNDS: " << nbCompounds << endl; ... #endif Sometimes it is surrounded with specific macros which were probably supposed to be defined in debug mode only but got into release mode as well and always contaminate the output. Example StepFile_Read.cxx: #define CHRONOMESURE ... #ifdef CHRONOMESURE sout << " ... STEP File Read ... " << endl; c.Show(); #endif Thus, the output is contaminated both for the end-user app and for the libraries which are based on OCC. Normally the library should not output anything. Consider other options for debugging needs for own OCC developers. Ideas for solutions: 0. Start with just enforcing this rule for any new modifications and prevent worsening the current situation. 1. Consider reuse of existing class(es) encapsulating debug output (e.g. similar to abstract CDM_MessageDriver and its subclasses; Message_* classes) 2. Design settings via API (e.g. trace level, destinations, etc) and environment variables. 3. Study other implementations (e.g. Qt's qDebug(), qWarning(),...) 4. Performance considerations. Avoid impact of this overhead infrastructure, e.g. by creating inlined no-ops in release mode. | ||||
Steps To Reproduce | Examples: 1. Launch Import/Export sample and see the log. 2. In DRAWEXE use stepread | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
Supportive community feedback: http://www.opencascade.org/org/forum/thread_22961/ |
|
Debug output should be suppressed now due to fixes for #25266 and 0025418. It still remains to elaborate consistent rules for this and add them to docs. |
|
Dear BugMaster, Problem is fixed by #0025266 and 0025418. Could you please close it. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-01-26 22:36 | Roman Lygin | New Issue | |
2012-01-26 22:36 | Roman Lygin | Assigned To | => abv |
2012-03-13 22:18 | Roman Lygin | Note Added: 0019958 | |
2014-10-28 04:23 |
|
Relationship added | duplicate of 0025418 |
2014-10-28 04:23 |
|
Target Version | => 6.8.0 |
2014-10-28 04:26 |
|
Relationship added | related to 0024091 |
2014-10-29 06:03 |
|
Target Version | 6.8.0 => 7.1.0 |
2014-10-29 06:06 |
|
Note Added: 0033792 | |
2016-11-03 17:07 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-13 15:57 |
|
Test case number | => Not needed |
2017-07-13 15:59 |
|
Note Added: 0068264 | |
2017-07-13 15:59 |
|
Assigned To | abv => bugmaster |
2017-07-13 15:59 |
|
Status | new => feedback |
2017-07-13 15:59 |
|
Note Edited: 0068264 | |
2017-07-13 16:20 | bugmaster | Status | feedback => closed |
2017-07-13 16:20 | bugmaster | Resolution | open => fixed |
2017-07-13 16:20 | bugmaster | Fixed in Version | => 6.8.0 |