Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 31, 2011, 5:15:13 PM (14 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/XMLPort.cc

    r7163 r8806  
    6464                        if (!this->sectionname_.empty())
    6565                        {
    66                             COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a valid classname." << std::endl;
     66                            orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a valid classname." << endl;
    6767                        }
    6868                        else
     
    7474                    if (!identifier->isA(objectIdentifier_))
    7575                    {
    76                         COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << std::endl;
     76                        orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not a '" << objectIdentifier_->getName() << "'." << endl;
    7777                        continue;
    7878                    }
    7979                    if (!identifier->isLoadable())
    8080                    {
    81                         COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not loadable." << std::endl;
     81                        orxout(internal_warning, context::xml) << object->getLoaderIndentation() << "'" << child->Value() << "' is not loadable." << endl;
    8282                        continue;
    8383                    }
     
    8787                    try
    8888                    {
    89                         COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
     89                        orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << endl;
    9090
    9191                        BaseObject* newObject = identifier->fabricate(object);
     
    9595                        {
    9696                            newObject->XMLPort(*child, XMLPort::LoadObject);
    97                             COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
     97                            orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
    9898                        }
    9999                        else
    100100                        {
    101                             COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << std::endl;
     101                            orxout(verbose, context::xml) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ')' << endl;
    102102                        }
    103 
    104                         COUT(5) << object->getLoaderIndentation();
    105103
    106104                        this->callLoadExecutor(object, newObject);
     
    109107                            newObject->XMLPort(*child, XMLPort::LoadObject);
    110108
    111                         COUT(5) << object->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
     109                        orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << endl;
    112110                    }
    113111                    catch (AbortLoadingException& ex)
    114112                    {
    115                         COUT(1) << "An error occurred while loading object, abort loading..." << std::endl;
     113                        orxout(internal_error, context::xml) << "An error occurred while loading object, abort loading..." << endl;
    116114                        throw ex;
    117115                    }
    118116                    catch (...)
    119117                    {
    120                         COUT(1) << "An error occurred while loading object:" << std::endl;
    121                         COUT(1) << Exception::handleMessage() << std::endl;
     118                        orxout(internal_error, context::xml) << "An error occurred while loading object:" << endl;
     119                        orxout(internal_error, context::xml) << Exception::handleMessage() << endl;
    122120                    }
    123121                }
     
    125123            catch (ticpp::Exception& ex)
    126124            {
    127                 COUT(1) << std::endl;
    128                 COUT(1) << "An error occurred in XMLPort.h while loading a '" << objectIdentifier_->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ':' << std::endl;
    129                 COUT(1) << ex.what() << std::endl;
     125                orxout(internal_error, context::xml) << endl;
     126                orxout(internal_error, context::xml) << "An error occurred in XMLPort.h while loading a '" << objectIdentifier_->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ':' << endl;
     127                orxout(internal_error, context::xml) << ex.what() << endl;
    130128            }
    131129        }
Note: See TracChangeset for help on using the changeset viewer.