Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 13, 2011, 11:58:07 PM (13 years ago)
Author:
landauf
Message:

Exported orxout() and the output levels to lua, replaces logMessage() and cout().
Note that OutputDefinitions.h is now included in the tolua section of core, even though the file is in util. But I guess that's ok.

Location:
code/branches/output/src/libraries
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/core/CMakeLists.txt

    r8729 r8840  
    8686    input/KeyBinder.h
    8787    input/KeyBinderManager.h
     88    ../util/output/OutputDefinitions.h
    8889  PCH_FILE
    8990    CorePrecompiledHeaders.h
  • code/branches/output/src/libraries/core/LuaState.cc

    r8806 r8840  
    3636}
    3737#include <loki/ScopeGuard.h>
    38 #include <boost/preprocessor/stringize.hpp>
    3938
    4039#include "util/Output.h"
     
    237236    }
    238237
    239     void LuaState::luaLog(unsigned int level, const std::string& message)
    240     {
    241 #pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: use correct level, inspect lua support (and remove boost include)")
    242         orxout(debug_output, context::lua) << "luaLog (level: " << level << "): " << message << endl;
     238    void LuaState::luaOutput(OutputLevel level, const std::string& context, const std::string& message)
     239    {
     240        orxout(level, registerContext(context)) << message << endl;
     241    }
     242
     243    void LuaState::luaOutput(OutputLevel level, const std::string& message)
     244    {
     245        orxout(level, context::lua) << message << endl;
     246    }
     247
     248    void LuaState::luaOutput(const std::string& message)
     249    {
     250        orxout(debug_output, context::lua) << message << endl;
    243251    }
    244252
  • code/branches/output/src/libraries/core/LuaState.h

    r8729 r8840  
    8383
    8484        void luaPrint(const std::string& str); // tolua_export
    85         void luaLog(unsigned int level, const std::string& message); // tolua_export
     85        void luaOutput(orxonox::level::OutputLevel level, const std::string& context, const std::string& message); // tolua_export
     86        void luaOutput(orxonox::level::OutputLevel level, const std::string& message); // tolua_export
     87        void luaOutput(const std::string& message); // tolua_export
    8688        bool fileExists(const std::string& filename); // tolua_export
    8789        std::string getSourceCode(const std::string& filename); // tolua_export
  • code/branches/output/src/libraries/core/command/Shell.cc

    r8837 r8840  
    3333
    3434#include "Shell.h"
    35 
    36 #include <boost/preprocessor/stringize.hpp>
    3735
    3836#include "util/Math.h"
  • code/branches/output/src/libraries/util/output/OutputDefinitions.h

    r8835 r8840  
    3939    const OutputContextContainer& subname() { static const OutputContextContainer& context = registerContext(#name, #subname); return context; }
    4040
     41// tolua_begin
    4142namespace orxonox
    4243{
     
    6364        };
    6465    }
     66// tolua_end
    6567
    6668    using namespace level;
     
    128130        }
    129131    }
    130 }
     132} // tolua_export
    131133
    132134#endif /* _OutputDefinitions_H__ */
Note: See TracChangeset for help on using the changeset viewer.