Archived issue #0023152

Possibility to have echo of DRAW commands in log file

Open CASCADEOCCT:DRAWclosed5 public notes

Search issues

Description

When some script is executed with "source" command in DRAW, only messages explicitly printed by 'puts' and similar commands, and final result of the script, are output.

For testing and debug (as well as learning / demonstration) it could be useful to see also actual commands being executed, and their intermediate results.

Currently this possibility is implemented in QADraw package as follows:

- If environment variable QA_DRAW is defined to "1", QADraw commands get loaded automatically, and other defined commands are substituted by wrapper

- If environment variable QA_print_command is defined to "1", this wrapper replicates the command being executed to standard error stream

- If environment variable QA_DUP is set to "1", this wrapper tries to capture all output of the command (by redirecting standard streams to temporary files) and dump it to Tcl interpretor

This approach has problems:

1. It is unnecessarily overcomplicated and tricky
2. Use of environment variables does not allow to change behavior dynamically (switch on/off during one DRAW session)
3. Capturing of cout seems to be not really useful, as most of commands can be handled well without this (to be checked)
4. Intermediate results of commands is lost anyway

I propose to implement this differently, on the level of Draw package:

a) Provide switch to enable / disable echo of the command to cerr (managed dynamically by dedicated DRAW command, e.g. 'decho')

b) Provide specific command (e.g. 'dsource') to run script from the file with this option and echo of each intermediate command enabled automatically

Public activity

5 archived notes

Participants are labeled by their role within this record.

01Commenter 1
The changes are pushed to Git branch CR23152; please review (see commit log for description of changes)
02Commenter 2
I added ios::sync_with_stdio() call to Draw::BasicCommands.
03Commenter 3
Dear Commenter 1,
The workbenches
KAS:dev:mkv-23152-occt (GIT branch CR)
KAS:dev:mkv-23152-products (GIT master)
were compiled on Linux platform.
There is compilation error in follwing file:

Info : -------> Draw_Interpretor.cxx
Error : Errors occured in Shell
/dn47/KAS/dev/mkv-23152-occt/src/Draw/Draw_Interpretor.cxx:34:16: error: io.h: No such file or directory

Error : Failed : Draw_Interpretor.cxx
Info : ----------------------- Compilation Report -----------------------
Info : Failed : :LOC:dev:mkv-23152-occt:Draw:source:Draw_Interpretor.cxx
Info : -----------------------------------------------------------------
04Commenter 4
Compilation error on Linux corrected; please test
05Commenter 5
Dear Commenter 1,
The workbenches
KAS:dev:mkv-23152-occt (GIT branch CR23152)
KAS:dev:mkv-23152-products (GIT master)
were compiled on Linux platform and tested.

Regression:
Not detected

Improvements:
Not detected

Testing case:
Test case for this bug is chl 935 Y0.
It is OK in this branch.

See results in /QADisk/occttests/results/KAS/dev/mkv-23152-products_27062012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120622-opt_22062012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification