This is the first working version of the new logging system. Some work
in fine tuning still needs to be done. But is reasonably OK now.
This commit is contained in:
+7
-8
@@ -6,7 +6,6 @@
|
||||
#include "sicsobj.h"
|
||||
#include "splitter.h"
|
||||
#include "initializer.h"
|
||||
#include "commandlog.h"
|
||||
#include "hipadaba.h"
|
||||
#include "sicshipadaba.h"
|
||||
#include "dynstring.h"
|
||||
@@ -516,14 +515,14 @@ static char *SctActionHandler(void *actionData, char *lastReply,
|
||||
emsg = GetHdbProp(node, eprop);
|
||||
if (emsg == NULL || con != controller->conn) {
|
||||
GetHdbPath(node, path, sizeof path);
|
||||
SCPrintf(con, eLogError,
|
||||
"ERROR: action {%s} in {%s} node %s:\nERROR: %s",
|
||||
snprintf(msg,sizeof(msg),"ERROR: action {%s} in {%s} node %s:\nERROR: %s",
|
||||
data->name, origScript, path, result);
|
||||
SCPureSockWrite(con, msg,eLogError);
|
||||
if(data != NULL && data->controller != NULL){
|
||||
traceIO(data->controller->node->name, "ERROR: action {%s} in {%s} node %s:\nERROR: %s",
|
||||
traceIO(data->controller->node->name, "ERROR: action {%s} in {%s} node %s:ERROR: %s",
|
||||
data->name, origScript, path, result);
|
||||
} else {
|
||||
traceIO("sctunknown", "ERROR: action {%s} in {%s} node %s:\nERROR: %s",
|
||||
traceIO("sctunknown", "ERROR: action {%s} in {%s} node %s:ERROR: %s",
|
||||
data->name, origScript, path, result);
|
||||
}
|
||||
}
|
||||
@@ -600,7 +599,7 @@ static char *SctActionHandler(void *actionData, char *lastReply,
|
||||
*/
|
||||
iMacro = SCinMacro(con);
|
||||
con->iMacro = 0;
|
||||
SCWrite(con, "o.k.", eWarning);
|
||||
SCPureSockWrite(con, "o.k.", eLog);
|
||||
SCsetMacro(con, iMacro);
|
||||
}
|
||||
}
|
||||
@@ -637,7 +636,8 @@ static char *SctActionHandler(void *actionData, char *lastReply,
|
||||
if (send == NULL)
|
||||
send = "";
|
||||
if (controller->verbose) {
|
||||
SCPrintf(con, eLog, "%6.3f send : %s", secondsOfMinute(), send);
|
||||
snprintf(msg,sizeof(msg),"%6.3f send : %s", secondsOfMinute(), send);
|
||||
SCPureSockWrite(con, msg,eLog);
|
||||
}
|
||||
if (controller->fd != NULL) {
|
||||
fprintf(controller->fd, "%6.3f send : %s\n", secondsOfMinute(), send);
|
||||
@@ -838,7 +838,6 @@ static hdbCallbackReturn SctActionCallback(Hdb * node, void *userData,
|
||||
if (script != NULL) {
|
||||
if (SctCallInContext(con, script, node, data->controller, &error) ==
|
||||
0) {
|
||||
/* SCPrintf(con, eError, "ERROR: in {%s}: %s", script, error); */
|
||||
SCPrintf(con, eError, "ERROR: %s", error); /* nicer for the user */
|
||||
SetHdbProperty(node, "target", NULL);
|
||||
SetHdbProperty(node, "requested", NULL);
|
||||
|
||||
Reference in New Issue
Block a user