Changeset eb5dfc6 in tol
- Timestamp:
- Mar 25, 2011, 6:48:48 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 315916e
- Parents:
- 9f1ad33
- Location:
- tol
- Files:
-
- 3 edited
-
bbasic/out.cpp (modified) (16 diffs)
-
bbasic/tol_bout.h (modified) (3 diffs)
-
btol/real_type/datgrav.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/bbasic/out.cpp
r9f1ad33 reb5dfc6 111 111 BBool BOut::warningTerm_; 112 112 BBool BOut::infoTerm_; 113 BBool BOut::stdLog_; 114 BBool BOut::traceLog_; 115 BBool BOut::errorLog_; 116 BBool BOut::warningLog_; 117 BBool BOut::infoLog_; 113 118 BText BOut::out_; 114 119 BText BOut::dumpFile_(StaticInit()); … … 144 149 BOut::warningTerm_ = BTRUE; 145 150 BOut::infoTerm_ = BTRUE; 151 BOut::stdLog_ = BTRUE; 152 BOut::traceLog_ = BTRUE; 153 BOut::errorLog_ = BTRUE; 154 BOut::warningLog_ = BTRUE; 155 BOut::infoLog_ = BTRUE; 146 156 BOut::out_ = ""; 147 157 BOut::dumpFile_ = ""; … … 253 263 /*! PURPOSE: Sets boolean value for infoTerm_ */ 254 264 void BOut::PutInfoTerm(BBool term) { infoTerm_ = term; } 265 /*! PURPOSE: Sets boolean value for errorLog_ */ 266 void BOut::PutErrorLog(BBool log_) { errorLog_ = log_; } 267 /*! PURPOSE: Sets boolean value for warningLog_ */ 268 void BOut::PutWarningLog(BBool log_) { warningLog_ = log_; } 269 /*! PURPOSE: Sets boolean value for traceLog_ */ 270 void BOut::PutTraceLog(BBool log_) { traceLog_ = log_; } 271 /*! PURPOSE: Sets boolean value for stdLog_ */ 272 void BOut::PutStdLog(BBool log_) { stdLog_ = log_; } 273 /*! PURPOSE: Sets boolean value for infoLog_ */ 274 void BOut::PutInfoLog(BBool log_) { infoLog_ = log_; } 275 255 276 /*! PURPOSE: Sets boolean value for all hci flags */ 256 277 void BOut::PutAllHci(BBool hci) … … 259 280 void BOut::PutAllTerm(BBool term) 260 281 { stdTerm_ = traceTerm_ = errorTerm_ = warningTerm_ = infoTerm_ = term; } 282 /*! PURPOSE: Sets boolean value for all log file flags */ 283 void BOut::PutAllLog(BBool log_) 284 { stdLog_ = traceLog_ = errorLog_ = warningLog_ = infoLog_ = log_; } 261 285 262 286 /*! PURPOSE: Gets boolean value of errorHci_ */ … … 280 304 /*! PURPOSE: Gets boolean value of infoTerm_ */ 281 305 BBool BOut::InfoTerm() { return(infoTerm_); } 306 /*! PURPOSE: Gets boolean value of errorLog_ */ 307 BBool BOut::ErrorLog() { return(errorLog_); } 308 /*! PURPOSE: Gets boolean value of errorLog_ */ 309 BBool BOut::WarningLog() { return(warningLog_); } 310 /*! PURPOSE: Gets boolean value of traceLog_ */ 311 BBool BOut::TraceLog() { return(traceLog_); } 312 /*! PURPOSE: Gets boolean value of stdLog_ */ 313 BBool BOut::StdLog() { return(stdLog_); } 314 /*! PURPOSE: Gets boolean value of infoLog_ */ 315 BBool BOut::InfoLog() { return(infoLog_); } 316 282 317 283 318 … … 386 421 //-------------------------------------------------------------------- 387 422 { 388 if(!BOut::IsEnabled() || (!BOut::errorHci_ && !BOut::errorTerm_)) { return; }389 if(!BOut::IsEnabled()) { return; }423 if(!BOut::IsEnabled() || 424 (!BOut::errorHci_ && !BOut::errorTerm_ && !BOut::errorLog_)) { return; } 390 425 /*BText info = "\nERROR: "; 391 426 info += txt + "\n";*/ … … 394 429 BOut::errorOpenTag_ + TOLErrorNumber().Format("[%.0lf] ") + txt + 395 430 BOut::errorCloseTag_; 396 BOut::Write(info, BOut::errorHci_, BOut::errorTerm_ );431 BOut::Write(info, BOut::errorHci_, BOut::errorTerm_, BOut::errorLog_); 397 432 BUserFunction::ShowCallStack(); 398 433 } … … 407 442 //-------------------------------------------------------------------- 408 443 { 409 if(!BOut::IsEnabled() || (!BOut::warningHci_ && !BOut::warningTerm_)) { return; } 444 if(!BOut::IsEnabled() || 445 (!BOut::warningHci_ && !BOut::warningTerm_ && !BOut::warningLog_)) { return; } 410 446 /*BText info = "\nWARNING: "; 411 447 info += txt + "\n";*/ … … 414 450 BOut::warningOpenTag_ + TOLWarningNumber().Format("[%.0lf] ") + txt + 415 451 BOut::warningCloseTag_; 416 BOut::Write(info, BOut::warningHci_, BOut::warningTerm_ );452 BOut::Write(info, BOut::warningHci_, BOut::warningTerm_, BOut::warningLog_); 417 453 } 418 454 … … 425 461 //-------------------------------------------------------------------- 426 462 { 427 if(!BOut::IsEnabled() || (!BOut::warningHci_ && !BOut::warningTerm_)) { return; } 463 if(!BOut::IsEnabled() || 464 (!BOut::warningHci_ && !BOut::warningTerm_ && !BOut::warningLog_)) { return; } 428 465 BText info = I2("\nDeprecated: ","\nDesaprobado: "); 429 466 info += txt + "\n"; 430 BOut::Write(info, BOut::warningHci_, BOut::warningTerm_ );467 BOut::Write(info, BOut::warningHci_, BOut::warningTerm_, BOut::warningLog_); 431 468 } 432 469 … … 439 476 //-------------------------------------------------------------------- 440 477 { 441 if(!BOut::IsEnabled() || (!BOut::stdHci_ && !BOut::stdTerm_)) { return; } 442 BOut::Write(txt, BOut::stdHci_, BOut::stdTerm_); 478 if(!BOut::IsEnabled() || 479 (!BOut::stdHci_ && !BOut::stdTerm_ && !BOut::stdLog_)) { return; } 480 BOut::Write(txt, BOut::stdHci_, BOut::stdTerm_, BOut::stdLog_); 443 481 } 444 482 … … 448 486 void Info(const BText& txt) 449 487 { 450 if(!BOut::IsEnabled() || (!BOut::infoHci_ && !BOut::infoTerm_)) { return; } 451 BOut::Write(txt, BOut::infoHci_, BOut::infoTerm_); 488 if(!BOut::IsEnabled() || 489 (!BOut::infoHci_ && !BOut::infoTerm_ && !BOut::infoLog_)) { return; } 490 BOut::Write(txt, BOut::infoHci_, BOut::infoTerm_, BOut::infoLog_); 452 491 } 453 492 … … 472 511 //-------------------------------------------------------------------- 473 512 { 474 if(!BOut::IsEnabled() || (!BOut::traceHci_ && !BOut::traceTerm_)) { return; } 513 if(!BOut::IsEnabled() || 514 (!BOut::traceHci_ && !BOut::traceTerm_ && !BOut::traceLog_)) { return; } 475 515 BText info = BText("\nTRACE ") +SystemInfo() + "\n" + txt + "\n"; 476 BOut::Write(info, BOut::traceHci_, BOut::traceTerm_ );516 BOut::Write(info, BOut::traceHci_, BOut::traceTerm_, BOut::traceLog_); 477 517 } 478 518 … … 489 529 490 530 //-------------------------------------------------------------------- 491 void BOut::Write(const BText& txt, BBool hci, BBool term )531 void BOut::Write(const BText& txt, BBool hci, BBool term, BBool log_) 492 532 493 533 /*! Sends a message \a txt to specified outputs (user defined and/or … … 501 541 //-------------------------------------------------------------------- 502 542 { 503 if(!BOut::IsEnabled() || (!hci && !term )) { return; }543 if(!BOut::IsEnabled() || (!hci && !term && !log_)) { return; } 504 544 if(hci) 505 545 { … … 516 556 } 517 557 } 518 if( BOut::HasDumpFile() && file_)558 if(log_ && BOut::HasDumpFile() && file_) 519 559 { 520 560 fprintf(file_,"%s",txt.String()); -
tol/bbasic/tol_bout.h
r9f1ad33 reb5dfc6 93 93 //! indicates if an INFO Level message must be sent to terminal 94 94 static BBool infoTerm_; 95 //! Boolean that indicates if standard messages must be sent to the log file 96 static BBool stdLog_; 97 //! Boolean that indicates if trace messages must be sent to the log file 98 static BBool traceLog_; 99 //! Boolean that indicates if error messages must be sent to the log file 100 static BBool errorLog_; 101 //! Boolean that indicates if warning messages must be sent to the log file 102 static BBool warningLog_; 103 //! indicates if an INFO Level message must be sent to the log file 104 static BBool infoLog_; 105 95 106 //! Send a message to specified outputs 96 static void Write (const BText& txt, BBool hci, BBool term );107 static void Write (const BText& txt, BBool hci, BBool term, BBool log_); 97 108 //! Pointer to user defined function to write TOL messages 98 109 static BHciWriter hciWriter_; … … 178 189 //! Sets boolean value for infoTerm_ 179 190 static void PutInfoTerm(BBool term); 191 //! Sets boolean value for errorLog_ 192 static void PutErrorLog(BBool log_); 193 //! Sets boolean value for warningLog_ 194 static void PutWarningLog(BBool log_); 195 //! Sets boolean value for traceLog_ 196 static void PutTraceLog(BBool log_); 197 //! Sets boolean value for stdLog_ 198 static void PutStdLog(BBool log_); 199 //! Sets boolean value for infoLog_ 200 static void PutInfoLog(BBool log_); 180 201 //! Sets boolean value for all terms 181 202 static void PutAllHci(BBool hci); 182 203 //! Sets boolean value for all hci 183 204 static void PutAllTerm(BBool term); 205 //! Sets boolean value for all log 206 static void PutAllLog(BBool log_); 184 207 185 208 static void setErrorTags(const char* openTag, const char * closeTag); … … 208 231 //! Gets boolean value of infoTerm_ 209 232 static BBool InfoTerm(); 233 //! Gets boolean value of errorLog_ 234 static BBool ErrorLog(); 235 //! Gets boolean value of traceLog_ 236 static BBool WarningLog(); 237 //! Gets boolean value of traceLog_ 238 static BBool TraceLog(); 239 //! Gets boolean value of stdLog_ 240 static BBool StdLog(); 241 //! Gets boolean value of infoLog_ 242 static BBool InfoLog(); 210 243 211 244 //! Returns a cleaned BText reference to concatenate message -
tol/btol/real_type/datgrav.cpp
r9f1ad33 reb5dfc6 71 71 //-------------------------------------------------------------------- 72 72 DeclareContensClass(BDat, BDatTemporary, BDatShowErrors); 73 DefExtOpr(1, BDatShowErrors, "Show", 1, 2, "Real Text", 74 I2("(Real show [, Text type=\"ALL\"])", 75 "(Real mostrar [, Text type=\"ALL\"])"), 76 I2(".", 77 "A partir de la llamada a esta función el sistem mostrará o no los " 78 "mensajes del tipo dado según sea cierto o no el parámetro <mostrar>." 79 "Los tipos posibles son : ALL, STANDARD, ERROR, WARNING, USER, TRACE" 80 "Devuelve el estado anterior a la llamada."), 73 DefExtOpr(1, BDatShowErrors, "Show", 1, 3, "Real Text Real", 74 "(Real show [, Text type=\"ALL\", Real disableLogAndCounters=False])", 75 I2("Enables or disables system messages of given <type>: " 76 "ALL, STANDARD, ERROR, WARNING, USER, TRACE\n" 77 "Returns the state before the call.\n" 78 "When <show> is false and <disableLogAndCounters> is true, log file, " 79 "and error and warning counters will be disabled too.", 80 "A partir de la llamada a esta función el sistema mostrará o no los " 81 "mensajes del tipo dado según sea cierto o no el parámetro <show>.\n" 82 "Los tipos posibles son : ALL, STANDARD, ERROR, WARNING, USER, TRACE\n" 83 "Devuelve el estado anterior a la llamada.\n" 84 "Cuando <show> es falso y <disableLogAndCounters> es cierto, se " 85 "deshabilitarán las salidas al fichero de log y los contadores de " 86 "errores y warnings, en el caso de " 87 "estén afectados por <type>"), 81 88 BOperClassify::TimeAlgebra_); 82 89 void BDatShowErrors::CalcContens() … … 85 92 BBool sh = (BBool)Real(Arg(1)); 86 93 BText type = ToUpper(Text(Arg(2))); 94 BBool disableLogAndCounters = false; 95 if(Arg(3)) 96 { 97 disableLogAndCounters = (BBool)Real(Arg(3)); 98 } 87 99 BBool all = (type=="ALL"); 88 100 BBool err = all || (type=="ERROR"); … … 97 109 BOut::PutStdTerm(sh); 98 110 BOut::PutStdHci(sh); 111 BOut::PutStdLog(sh || !disableLogAndCounters); 99 112 } 100 113 if(err) … … 103 116 BOut::PutErrorTerm(sh); 104 117 BOut::PutErrorHci(sh); 118 BOut::PutErrorLog(sh || !disableLogAndCounters); 105 119 } 106 120 if(war) … … 109 123 BOut::PutWarningTerm(sh); 110 124 BOut::PutWarningHci(sh); 125 BOut::PutWarningLog(sh || !disableLogAndCounters); 111 126 } 112 127 if(trc) … … 115 130 BOut::PutTraceTerm(sh); 116 131 BOut::PutTraceHci(sh); 132 BOut::PutTraceLog(sh || !disableLogAndCounters); 117 133 } 118 134 if(inf) … … 121 137 BOut::PutInfoTerm(sh); 122 138 BOut::PutInfoHci(sh); 139 BOut::PutInfoLog(sh || !disableLogAndCounters); 123 140 } 124 141 contens_ = oldSh;
Note: See TracChangeset
for help on using the changeset viewer.
