Skip to content

Commit

Permalink
forward Lua print() to Ardour's Log.
Browse files Browse the repository at this point in the history
  • Loading branch information
x42 committed Aug 26, 2016
1 parent 5c12de7 commit ddc4e61
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions gtk2_ardour/luainstance.cc
Expand Up @@ -814,11 +814,12 @@ using namespace ARDOUR_UI_UTILS;
using namespace PBD;
using namespace std;

#ifndef NDEBUG
static void _lua_print (std::string s) {
#ifndef NDEBUG
std::cout << "LuaInstance: " << s << "\n";
}
#endif
PBD::info << "LuaInstance: " << s << endmsg;
}

LuaInstance* LuaInstance::_instance = 0;

Expand All @@ -834,9 +835,7 @@ LuaInstance::instance ()

LuaInstance::LuaInstance ()
{
#ifndef NDEBUG
lua.Print.connect (&_lua_print);
#endif
init ();

LuaScriptParamList args;
Expand Down Expand Up @@ -1293,9 +1292,7 @@ LuaInstance::register_lua_slot (const std::string& name, const std::string& scri
ActionHook ah;
try {
LuaState l;
#ifndef NDEBUG
l.Print.connect (&_lua_print);
#endif
lua_State* L = l.getState();
register_hooks (L);
l.do_command ("function ardour () end");
Expand Down Expand Up @@ -1491,9 +1488,7 @@ LuaCallback::get_state (void)
void
LuaCallback::init (void)
{
#ifndef NDEBUG
lua.Print.connect (&_lua_print);
#endif

lua.do_command (
"function ScriptManager ()"
Expand Down

0 comments on commit ddc4e61

Please sign in to comment.