Ignore:
Timestamp:
Nov 23, 2009, 6:22:33 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
3d4969
Parents:
09d3b8
Message:

Verbosity corrected for ERROR and WARNING

  • present ERROR and WARNING prefixes removed and placed by eLog() and respective Verbosity().
  • -v... is scanned for number of 'v's and verbosity is set accordingly
  • standard verbosity is now 0.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r09d3b8 r418117a  
    9595  switch (choice) {
    9696    default:
    97       Log() << Verbose(0) << "Not a valid choice." << endl;
     97      eLog() << Verbose(2) << "Not a valid choice." << endl;
    9898      break;
    9999      case 'a': // absolute coordinates of atom
     
    109109        valid = true;
    110110        do {
    111           if (!valid) Log() << Verbose(0) << "Resulting position out of cell." << endl;
     111          if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;
    112112          Log() << Verbose(0) << "Enter reference coordinates." << endl;
    113113          x.AskPosition(mol->cell_size, true);
     
    125125        valid = true;
    126126        do {
    127           if (!valid) Log() << Verbose(0) << "Resulting position out of cell." << endl;
     127          if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;
    128128          second = mol->AskAtom("Enter atom number: ");
    129129          Log() << Verbose(0) << "Enter relative coordinates." << endl;
     
    142142        do {
    143143          if (!valid) {
    144             Log() << Verbose(0) << "Resulting coordinates out of cell - ";
    145             first->x.Output();
    146             Log() << Verbose(0) << endl;
     144            eLog() << Verbose(2) << "Resulting coordinates out of cell - " << first->x << endl;
    147145          }
    148146          Log() << Verbose(0) << "First, we need two atoms, the first atom is the central, while the second is the outer one." << endl;
     
    671669  Log() << Verbose(0) << "===============================================" << endl;
    672670  if (molecules->NumberOfActiveMolecules() > 1)
    673     Log() << Verbose(0) << "WARNING: There is more than one molecule active! Atoms will be added to each." << endl;
     671    eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;
    674672  Log() << Verbose(0) << "INPUT: ";
    675673  cin >> choice;
     
    794792  Log() << Verbose(0) << "===============================================" << endl;
    795793  if (molecules->NumberOfActiveMolecules() > 1)
    796     Log() << Verbose(0) << "WARNING: There is more than one molecule active! Atoms will be added to each." << endl;
     794    eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;
    797795  Log() << Verbose(0) << "INPUT: ";
    798796  cin >> choice;
     
    827825          }
    828826          if (count != j)
    829             Log() << Verbose(0) << "ERROR: AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
     827            eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
    830828          x.Zero();
    831829          y.Zero();
     
    12501248
    12511249  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    1252     eLog() << Verbose(0) << "WARNING: config is found under different path then stated in config file::defaultpath!" << endl;
     1250    eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
    12531251  }
    12541252
     
    13541352
    13551353  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    1356     eLog() << Verbose(0) << "WARNING: config is found under different path then stated in config file::defaultpath!" << endl;
     1354    eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
    13571355  }
    13581356
     
    13871385  molecule *mol = NULL;
    13881386  string BondGraphFileName("");
     1387  int verbosity = 0;
    13891388  strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1);
    13901389
     
    14321431            Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl;
    14331432            Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl;
    1434             Log() << Verbose(0) << "\t-v/-V\t\tGives version information." << endl;
     1433            Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl;
     1434            Log() << Verbose(0) << "\t-V\t\tGives version information." << endl;
    14351435            Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl;
    14361436            return (1);
    14371437            break;
    14381438          case 'v':
     1439            while (argv[argptr-1][verbosity+1] == 'v') {
     1440              verbosity++;
     1441            }
     1442            setVerbosity(verbosity);
     1443            Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl;
     1444            break;
    14391445          case 'V':
    14401446            Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl;
     
    18411847                  }
    18421848                } else {
    1843                   eLog() << Verbose(0) << "Removal failed due to missing atoms on molecule or wrong id." << endl;
     1849                  eLog() << Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl;
    18441850                }
    18451851                argptr+=2;
     
    20022008              j = atoi(argv[argptr++]);
    20032009              if ((j<0) || (j>1)) {
    2004                 eLog() << Verbose(1) << "ERROR: Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl;
     2010                eLog() << Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl;
    20052011                j = 0;
    20062012              }
     
    20642070//                  repetition[i] = atoi(argv[argptr++]);
    20652071//                  if (repetition[i] < 1)
    2066 //                    eLog() << Verbose(0) << "ERROR: repetition value must be greater 1!" << endl;
     2072//                    eLog() << Verbose(1) << "repetition value must be greater 1!" << endl;
    20672073//                  repetition[i] = 1;
    20682074//                }
     
    20832089                  Vector ** vectors;
    20842090                  if (faktor < 1) {
    2085                     eLog() << Verbose(0) << "ERROR: Repetition faktor mus be greater than 1!" << endl;
     2091                    eLog() << Verbose(1) << "Repetition factor mus be greater than 1!" << endl;
    20862092                    faktor = 1;
    20872093                  }
     
    21002106                    }
    21012107                    if (count != j)
    2102                       Log() << Verbose(0) << "ERROR: AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
     2108                      eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
    21032109                    x.Zero();
    21042110                    y.Zero();
     
    21652171  int j;
    21662172
    2167   setVerbosity(2);
     2173  setVerbosity(0);
    21682174
    21692175  // =========================== PARSE COMMAND LINE OPTIONS ====================================
Note: See TracChangeset for help on using the changeset viewer.