Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 31, 2011, 5:15:13 PM (13 years ago)
Author:
landauf
Message:

Replaced COUT with orxout in core. Tried to set levels and contexts in a more or less useful way, but not really optimized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/core/command/ConsoleCommand.cc

    r8316 r8806  
    172172                if (!this->executor_->defaultValueSet(i))
    173173                {
    174                     COUT(2) << "Default value " << i << " is missing" << std::endl;
     174                    orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
    175175                    return false;
    176176                }
     
    202202                if (!executor->defaultValueSet(i))
    203203                {
    204                     COUT(2) << "Default value " << i << " is missing" << std::endl;
     204                    orxout(internal_warning, context::commands) << "Default value " << i << " is missing" << endl;
    205205                    return false;
    206206                }
     
    229229        else
    230230        {
    231             COUT(1) << "Error: Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
     231            orxout(internal_error, context::commands) << "Couldn't assign new executor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
    232232            return false;
    233233        }
     
    256256        else
    257257        {
    258             COUT(1) << "Error: Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << std::endl;
     258            orxout(internal_error, context::commands) << "Couldn't assign new functor to console command \"" << this->baseName_ << "\", headers don't match." << endl;
    259259            return false;
    260260        }
     
    307307            this->pushFunction(new Executor(*this->executor_.get()));
    308308        else
    309             COUT(1) << "Error: Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     309            orxout(internal_error, context::commands) << "Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << endl;
    310310    }
    311311
     
    367367            }
    368368            else if (object)
    369                 COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << std::endl;
     369                orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no functor set." << endl;
    370370        }
    371371        else if (object)
    372             COUT(1) << "Error: Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     372            orxout(internal_error, context::commands) << "Can't assign object to console command \"" << this->baseName_ << "\", no executor set." << endl;
    373373
    374374        return false;
     
    418418            this->executor_->setDefaultValues(arg1);
    419419        else
    420             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     420            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    421421
    422422        return *this;
     
    431431            this->executor_->setDefaultValues(arg1, arg2);
    432432        else
    433             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     433            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    434434
    435435        return *this;
     
    444444            this->executor_->setDefaultValues(arg1, arg2, arg3);
    445445        else
    446             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     446            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    447447
    448448        return *this;
     
    457457            this->executor_->setDefaultValues(arg1, arg2, arg3, arg4);
    458458        else
    459             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     459            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    460460
    461461        return *this;
     
    470470            this->executor_->setDefaultValues(arg1, arg2, arg3, arg4, arg5);
    471471        else
    472             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     472            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    473473
    474474        return *this;
     
    485485            this->executor_->setDefaultValue(index, arg);
    486486        else
    487             COUT(1) << "Error: Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << std::endl;
     487            orxout(internal_error, context::commands) << "Can't set default values in console command \"" << this->baseName_ << "\", no executor set." << endl;
    488488
    489489        return *this;
     
    500500            this->argumentCompleter_[index] = completer;
    501501        else
    502             COUT(2) << "Warning: Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << std::endl;
     502            orxout(internal_warning, context::commands) << "Couldn't add autocompletion-function for index " << index << " in console command \"" << this->baseName_ << "\": index out of bound." << endl;
    503503
    504504        return *this;
     
    611611        {
    612612            if (group == "")
    613                 COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
     613                orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
    614614            else
    615                 COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
     615                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
    616616        }
    617617        return 0;
     
    644644        {
    645645            if (group == "")
    646                 COUT(1) << "Error: Couldn't find console command with shortcut \"" << name << "\"" << std::endl;
     646                orxout(internal_error, context::commands) << "Couldn't find console command with shortcut \"" << name << "\"" << endl;
    647647            else
    648                 COUT(1) << "Error: Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << std::endl;
     648                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
    649649        }
    650650        return 0;
     
    681681        {
    682682            if (group == "")
    683                 COUT(2) << "Warning: A console command with shortcut \"" << name << "\" already exists." << std::endl;
     683                orxout(internal_warning, context::commands) << "A console command with shortcut \"" << name << "\" already exists." << endl;
    684684            else
    685                 COUT(2) << "Warning: A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << std::endl;
     685                orxout(internal_warning, context::commands) << "A console command with name \"" << name << "\" already exists in group \"" << group << "\"." << endl;
    686686        }
    687687        else
Note: See TracChangeset for help on using the changeset viewer.