Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions planning/src/RS/rsOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,36 +115,36 @@ void rsOpts::print(CStr label) const noexcept {
cout << label;
else
cout << endl;
printf(" argc_ = %i\n", argc_);
::printf(" argc_ = %i\n", argc_);
if (argv_) {
for (int i = 1; i < argc_; i++) printf(" argv[%i] = %s", i, argv_[i]);
for (int i = 1; i < argc_; i++) ::printf(" argv[%i] = %s", i, argv_[i]);
} else {
lputs("\n\t !!! no argv_");
}
lputs();

bool exi = input_file_exists(deviceXML_);
printf(" deviceXML_: %s exists:%i\n", nns(deviceXML_), exi);
::printf(" deviceXML_: %s exists:%i\n", nns(deviceXML_), exi);

exi = input_file_exists(csvFile_);
printf(" csvFile_: %s exists:%i\n", nns(csvFile_), exi);
::printf(" csvFile_: %s exists:%i\n", nns(csvFile_), exi);

printf(" pcfFile_: %s\n", nns(pcfFile_));
printf(" blifFile_: %s\n", nns(blifFile_));
printf(" jsonFile_: %s\n", nns(jsonFile_));
printf(" editsFile_: %s\n", nns(editsFile_));
printf(" output_: %s\n", nns(output_));
printf(" assignOrder_: %s\n", nns(assignOrder_));
::printf(" pcfFile_: %s\n", nns(pcfFile_));
::printf(" blifFile_: %s\n", nns(blifFile_));
::printf(" jsonFile_: %s\n", nns(jsonFile_));
::printf(" editsFile_: %s\n", nns(editsFile_));
::printf(" output_: %s\n", nns(output_));
::printf(" assignOrder_: %s\n", nns(assignOrder_));

printf(" input_: %s\n", nns(input_));
::printf(" input_: %s\n", nns(input_));

printf(" test_id_ = %i\n", test_id_);
printf(" trace_ = %i traceIndex_ = %i\n", trace_, traceIndex_);
::printf(" test_id_ = %i\n", test_id_);
::printf(" trace_ = %i traceIndex_ = %i\n", trace_, traceIndex_);
cout << " trace_specified: " << std::boolalpha << trace_specified() << '\n';
cout << " unit_specified: " << std::boolalpha << unit_specified() << endl;

printf(" help_:%i check_:%i\n", help_, check_);
printf(" ver:%i det_ver_:%i\n", version_, det_ver_);
::printf(" help_:%i check_:%i\n", help_, check_);
::printf(" ver:%i det_ver_:%i\n", version_, det_ver_);

lputs();
#endif // RSBE_UNIT_TEST_ON
Expand All @@ -168,10 +168,13 @@ void rsOpts::printHelp() const noexcept {
CStr hlp = tab1[i+1];
if (!hlp)
break;
printf("%30s : %s\n", opt, hlp);
::printf("%30s : %s\n", opt, hlp);
}

flush_out(true);
cout << endl;
::printf("Logfile can be specified by env variable RS_PLN_LOGFILE\n");
::printf("Default logfile is 'rs_planner.log'\n");
cout << endl;
}

static char* make_file_name(CStr arg) noexcept {
Expand Down
2 changes: 1 addition & 1 deletion planning/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static const char* _pln_VERSION_STR = "pln0349";
static const char* _pln_VERSION_STR = "pln0350";

#include "RS/rsEnv.h"
#include "util/pln_log.h"
Expand Down
13 changes: 13 additions & 0 deletions planning/src/util/pln_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ bool open_pln_logfile(CStr fn) noexcept {
assert(fn and fn[0]);
if (_plnLF.is_open())
return false;

CStr env_fn = ::getenv("RS_PLN_LOGFILE");
if (env_fn and env_fn[0]) {
if (fn and ::strcmp(fn, env_fn)) {
cout << endl;
::printf("PLN: using logfile name '%s' from env variable %s\n",
env_fn, "RS_PLN_LOGFILE");
cout << endl; cout.flush();
fflush(stdout);
}
fn = env_fn;
}

if (!fn or !fn[0])
return false;

Expand Down
Loading