From 3c4f855e6dc7373cd7886c1c6c0821c277acbcd1 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 7 Jan 2009 19:50:25 +0000 Subject: [PATCH] Print NSE event messages with --script-trace also. --- nse_main.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nse_main.cc b/nse_main.cc index 4c774039e..c05224b73 100644 --- a/nse_main.cc +++ b/nse_main.cc @@ -437,11 +437,11 @@ int process_mainloop(lua_State *L) { std::list::iterator iter; struct timeval now; - SCRIPT_ENGINE_DEBUGGING( + if (o.debugging || o.scriptTrace()) { log_write(LOG_STDOUT, "Running %d script threads:\n", unfinished); for (iter = running_scripts.begin(); iter != running_scripts.end(); iter++) log_script_started(*iter); - ) + } // while there are scripts in running or waiting state, we loop. // we rely on nsock_loop to protect us from busy loops when @@ -489,7 +489,7 @@ int process_mainloop(lua_State *L) { current = *(running_scripts.begin()); if (current.rr.host->timedOut(&now)) { - if (o.debugging || o.verbose > 1) + if (o.debugging || o.verbose > 1 || o.scriptTrace()) log_script_timeout(current); SCRIPT_ENGINE_TRY(process_finalize(L, current.registry_idx)); continue; @@ -512,7 +512,7 @@ int process_mainloop(lua_State *L) { // then we release the thread and remove it from the // running_scripts list - if (o.debugging) + if (o.debugging || o.scriptTrace()) log_script_finished(current); if(lua_isstring (current.thread, 2)) { // FIXME @@ -538,7 +538,7 @@ int process_mainloop(lua_State *L) { } else { // this script returned because of an error // print the failing reason if the verbose level is high enough - if (o.debugging) + if (o.debugging || o.scriptTrace()) log_script_error(current); SCRIPT_ENGINE_TRY(process_finalize(L, current.registry_idx)); }