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/command/TclBind.cc

    r8788 r8806  
    106106            }
    107107            catch (Tcl::tcl_error const &e)
    108             {   COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl;   }
     108            {   orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl;   }
    109109        }
    110110    }
     
    129129        }
    130130        catch (Tcl::tcl_error const &e)
    131         {   COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl; COUT(1) << "Error: Tcl isn't properly initialized. Orxonox might possibly not work like that." << std::endl;   }
     131        {
     132            orxout(internal_error, context::tcl) << "Tcl error while creating Tcl-interpreter: " << e.what() << endl;
     133            orxout(user_error, context::tcl) << "Tcl isn't properly initialized. Orxonox might possibly not work like that." << endl;
     134        }
    132135
    133136        return interpreter;
     
    154157    std::string TclBind::tcl_query(Tcl::object const &args)
    155158    {
    156         COUT(4) << "Tcl_query: " << args.get() << std::endl;
     159        orxout(verbose, context::commands) << "Tcl_query: " << args.get() << endl;
    157160        return TclBind::tcl_helper(args, true);
    158161    }
     
    163166    void TclBind::tcl_execute(Tcl::object const &args)
    164167    {
    165         COUT(4) << "Tcl_execute: " << args.get() << std::endl;
     168        orxout(verbose, context::commands) << "Tcl_execute: " << args.get() << endl;
    166169        TclBind::tcl_helper(args, false);
    167170    }
     
    186189        switch (error)
    187190        {
    188             case CommandExecutor::Error:       COUT(1) << "Error: Can't execute command \"" << command << "\", command doesn't exist. (B)" << std::endl; break;
    189             case CommandExecutor::Incomplete:  COUT(1) << "Error: Can't execute command \"" << command << "\", not enough arguments given. (B)" << std::endl; break;
    190             case CommandExecutor::Deactivated: COUT(1) << "Error: Can't execute command \"" << command << "\", command is not active. (B)" << std::endl; break;
    191             case CommandExecutor::Denied:      COUT(1) << "Error: Can't execute command \"" << command << "\", access denied. (B)" << std::endl; break;
     191            case CommandExecutor::Error:       orxout(user_error) << "Can't execute command \"" << command << "\", command doesn't exist. (B)" << endl; break;
     192            case CommandExecutor::Incomplete:  orxout(user_error) << "Can't execute command \"" << command << "\", not enough arguments given. (B)" << endl; break;
     193            case CommandExecutor::Deactivated: orxout(user_error) << "Can't execute command \"" << command << "\", command is not active. (B)" << endl; break;
     194            case CommandExecutor::Denied:      orxout(user_error) << "Can't execute command \"" << command << "\", access denied. (B)" << endl; break;
    192195        }
    193196
    194197        if (error == CommandExecutor::Error)
    195             COUT(3) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << std::endl;
     198            orxout(user_info) << "Did you mean \"" << evaluation.getCommandSuggestion() << "\"?" << endl;
    196199
    197200        return result;
     
    211214            }
    212215            catch (Tcl::tcl_error const &e)
    213             {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
     216            {   orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl;   }
    214217        }
    215218
     
    223226    void TclBind::bgerror(const std::string& error)
    224227    {
    225         COUT(1) << "Tcl background error: " << stripEnclosingBraces(error) << std::endl;
     228        orxout(user_error, context::tcl) << "Tcl background error: " << stripEnclosingBraces(error) << endl;
    226229    }
    227230
     
    243246        }
    244247        catch (Tcl::tcl_error const &e)
    245         {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
     248        {   orxout(user_error, context::tcl) << "Tcl error: " << e.what() << endl;   }
    246249
    247250        if (error)
Note: See TracChangeset for help on using the changeset viewer.