Changeset eb5dfc6 in tol


Ignore:
Timestamp:
Mar 25, 2011, 6:48:48 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
315916e
Parents:
9f1ad33
Message:

Fixes #1143

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3362 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tol/bbasic/out.cpp

    r9f1ad33 reb5dfc6  
    111111BBool      BOut::warningTerm_;
    112112BBool      BOut::infoTerm_;
     113BBool      BOut::stdLog_;
     114BBool      BOut::traceLog_;
     115BBool      BOut::errorLog_;
     116BBool      BOut::warningLog_;
     117BBool      BOut::infoLog_;
    113118BText      BOut::out_;
    114119BText      BOut::dumpFile_(StaticInit());
    … …  
    144149    BOut::warningTerm_ = BTRUE;
    145150    BOut::infoTerm_    = BTRUE;
     151    BOut::stdLog_     = BTRUE;
     152    BOut::traceLog_   = BTRUE;
     153    BOut::errorLog_   = BTRUE;
     154    BOut::warningLog_ = BTRUE;
     155    BOut::infoLog_    = BTRUE;
    146156    BOut::out_         = "";
    147157    BOut::dumpFile_    = "";
    … …  
    253263/*! PURPOSE: Sets boolean value for infoTerm_ */
    254264void  BOut::PutInfoTerm(BBool term) { infoTerm_ = term; }
     265/*! PURPOSE: Sets boolean value for errorLog_ */
     266void  BOut::PutErrorLog(BBool log_) { errorLog_ = log_; }
     267/*! PURPOSE: Sets boolean value for warningLog_ */
     268void  BOut::PutWarningLog(BBool log_) { warningLog_ = log_; }
     269/*! PURPOSE: Sets boolean value for traceLog_ */
     270void  BOut::PutTraceLog(BBool log_) { traceLog_ = log_; }
     271/*! PURPOSE: Sets boolean value for stdLog_ */
     272void  BOut::PutStdLog(BBool log_) { stdLog_ = log_; }
     273/*! PURPOSE: Sets boolean value for infoLog_ */
     274void  BOut::PutInfoLog(BBool log_) { infoLog_ = log_; }
     275
    255276/*! PURPOSE: Sets boolean value for all hci flags */
    256277void  BOut::PutAllHci(BBool hci)
    … …  
    259280void  BOut::PutAllTerm(BBool term)
    260281{ stdTerm_ = traceTerm_ = errorTerm_ = warningTerm_ = infoTerm_ = term; }
     282/*! PURPOSE: Sets boolean value for all log file flags */
     283void  BOut::PutAllLog(BBool log_)
     284{ stdLog_ = traceLog_ = errorLog_ = warningLog_ = infoLog_ = log_; }
    261285
    262286/*! PURPOSE: Gets boolean value of errorHci_ */
    … …  
    280304/*! PURPOSE: Gets boolean value of infoTerm_ */
    281305BBool BOut::InfoTerm() { return(infoTerm_); }
     306/*! PURPOSE: Gets boolean value of errorLog_ */
     307BBool BOut::ErrorLog() { return(errorLog_); }
     308/*! PURPOSE: Gets boolean value of errorLog_ */
     309BBool BOut::WarningLog() { return(warningLog_); }
     310/*! PURPOSE: Gets boolean value of traceLog_ */
     311BBool BOut::TraceLog() { return(traceLog_); }
     312/*! PURPOSE: Gets boolean value of stdLog_ */
     313BBool BOut::StdLog() { return(stdLog_); }
     314/*! PURPOSE: Gets boolean value of infoLog_ */
     315BBool BOut::InfoLog() { return(infoLog_); }
     316
    282317
    283318
    … …  
    386421//--------------------------------------------------------------------
    387422{
    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; }
    390425  /*BText info =  "\nERROR: ";
    391426    info += txt + "\n";*/
    … …  
    394429    BOut::errorOpenTag_ + TOLErrorNumber().Format("[%.0lf] ") + txt +
    395430    BOut::errorCloseTag_;
    396   BOut::Write(info, BOut::errorHci_, BOut::errorTerm_);
     431  BOut::Write(info, BOut::errorHci_, BOut::errorTerm_, BOut::errorLog_);
    397432  BUserFunction::ShowCallStack();
    398433}
    … …  
    407442//--------------------------------------------------------------------
    408443{
    409   if(!BOut::IsEnabled() || (!BOut::warningHci_ && !BOut::warningTerm_)) { return; }
     444  if(!BOut::IsEnabled()  ||
     445    (!BOut::warningHci_ && !BOut::warningTerm_ && !BOut::warningLog_)) { return; }
    410446  /*BText info =  "\nWARNING: ";
    411447  info += txt + "\n";*/
    … …  
    414450    BOut::warningOpenTag_ + TOLWarningNumber().Format("[%.0lf] ") + txt +
    415451    BOut::warningCloseTag_;
    416   BOut::Write(info, BOut::warningHci_, BOut::warningTerm_);
     452  BOut::Write(info, BOut::warningHci_, BOut::warningTerm_, BOut::warningLog_);
    417453}
    418454
    … …  
    425461//--------------------------------------------------------------------
    426462{
    427   if(!BOut::IsEnabled() || (!BOut::warningHci_ && !BOut::warningTerm_)) { return; }
     463  if(!BOut::IsEnabled()  ||
     464    (!BOut::warningHci_ && !BOut::warningTerm_ && !BOut::warningLog_)) { return; }
    428465  BText info = I2("\nDeprecated: ","\nDesaprobado: ");
    429466  info += txt + "\n";
    430   BOut::Write(info, BOut::warningHci_, BOut::warningTerm_);
     467  BOut::Write(info, BOut::warningHci_, BOut::warningTerm_, BOut::warningLog_);
    431468}
    432469
    … …  
    439476//--------------------------------------------------------------------
    440477{
    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_);
    443481}
    444482
    … …  
    448486void Info(const BText& txt)
    449487{
    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_);
    452491}
    453492
    … …  
    472511//--------------------------------------------------------------------
    473512{
    474   if(!BOut::IsEnabled() || (!BOut::traceHci_ && !BOut::traceTerm_)) { return; }
     513  if(!BOut::IsEnabled() ||
     514    (!BOut::traceHci_ && !BOut::traceTerm_ && !BOut::traceLog_)) { return; }
    475515  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_);
    477517}
    478518
    … …  
    489529
    490530//--------------------------------------------------------------------
    491 void BOut::Write(const BText& txt, BBool hci, BBool term)
     531void BOut::Write(const BText& txt, BBool hci, BBool term, BBool log_)
    492532
    493533/*! Sends a message \a txt to specified outputs (user defined and/or
    … …  
    501541//--------------------------------------------------------------------
    502542{
    503   if(!BOut::IsEnabled() || (!hci && !term)) { return; }
     543  if(!BOut::IsEnabled() || (!hci && !term && !log_)) { return; }
    504544  if(hci)
    505545  {
    … …  
    516556    }
    517557  }
    518   if(BOut::HasDumpFile() && file_)
     558  if(log_ && BOut::HasDumpFile() && file_)
    519559  {
    520560    fprintf(file_,"%s",txt.String());
  • tol/bbasic/tol_bout.h

    r9f1ad33 reb5dfc6  
    9393  //! indicates if an INFO Level message must be sent to terminal
    9494  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
    95106  //! 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_);
    97108  //! Pointer to user defined function to write TOL messages
    98109  static BHciWriter hciWriter_;
    … …  
    178189  //! Sets boolean value for infoTerm_
    179190  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_);
    180201  //! Sets boolean value for all terms
    181202  static void PutAllHci(BBool hci);
    182203  //! Sets boolean value for all hci
    183204  static void PutAllTerm(BBool term);
     205  //! Sets boolean value for all log
     206  static void PutAllLog(BBool log_);
    184207
    185208  static void setErrorTags(const char* openTag, const char * closeTag);
    … …  
    208231  //! Gets boolean value of infoTerm_
    209232  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();
    210243
    211244  //! Returns a cleaned BText reference to concatenate message
  • tol/btol/real_type/datgrav.cpp

    r9f1ad33 reb5dfc6  
    7171//--------------------------------------------------------------------
    7272  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>"),
    8188     BOperClassify::TimeAlgebra_);
    8289  void BDatShowErrors::CalcContens()
    … …  
    8592  BBool sh   = (BBool)Real(Arg(1));
    8693  BText type = ToUpper(Text(Arg(2)));
     94  BBool disableLogAndCounters = false;
     95  if(Arg(3))
     96  {
     97    disableLogAndCounters = (BBool)Real(Arg(3));
     98  }
    8799  BBool all  = (type=="ALL");
    88100  BBool err  = all || (type=="ERROR");
    … …  
    97109    BOut::PutStdTerm(sh);
    98110    BOut::PutStdHci(sh);
     111    BOut::PutStdLog(sh || !disableLogAndCounters);
    99112  }
    100113  if(err)
    … …  
    103116    BOut::PutErrorTerm(sh);
    104117    BOut::PutErrorHci(sh);
     118    BOut::PutErrorLog(sh || !disableLogAndCounters);
    105119  }
    106120  if(war)
    … …  
    109123    BOut::PutWarningTerm(sh);
    110124    BOut::PutWarningHci(sh);
     125    BOut::PutWarningLog(sh || !disableLogAndCounters);
    111126  }
    112127  if(trc)
    … …  
    115130    BOut::PutTraceTerm(sh);
    116131    BOut::PutTraceHci(sh);
     132    BOut::PutTraceLog(sh || !disableLogAndCounters);
    117133  }
    118134  if(inf)
    … …  
    121137    BOut::PutInfoTerm(sh);
    122138    BOut::PutInfoHci(sh);
     139    BOut::PutInfoLog(sh || !disableLogAndCounters);
    123140  }
    124141  contens_ = oldSh;
Note: See TracChangeset for help on using the changeset viewer.