- allow scriptcontext objects to be dynamic
- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
24
commandlog.c
24
commandlog.c
@@ -89,7 +89,6 @@ void WriteToCommandLogId(char *prompt, int id, char *text)
|
||||
return;
|
||||
strncpy(pCopy, text, l);
|
||||
pCopy[l] = '\0';
|
||||
|
||||
if (prompt == cmdPrompt && iCompact) {
|
||||
pPtr = strstr(pCopy, "fulltransact ");
|
||||
if (pPtr && pPtr < pCopy + 3) {
|
||||
@@ -101,17 +100,30 @@ void WriteToCommandLogId(char *prompt, int id, char *text)
|
||||
}
|
||||
}
|
||||
|
||||
now = time(NULL);
|
||||
|
||||
/* create tail buffer as needed */
|
||||
if (!pTail) {
|
||||
pTail = createCircular(MAXTAIL, free);
|
||||
}
|
||||
|
||||
now = time(NULL);
|
||||
|
||||
doStamp = 0;
|
||||
doStampId = 0;
|
||||
|
||||
if (id == NOID) {
|
||||
if (iCompact == 1) {
|
||||
nowTm = localtime(&now);
|
||||
strftime(stamp1, sizeof stamp1, "%H:%M:%S", nowTm);
|
||||
if (prompt == NULL)
|
||||
prompt = "";
|
||||
if (id == NOID) {
|
||||
if (!prompt)
|
||||
prompt = " ";
|
||||
snprintf(buffer, sizeof buffer, "%s %s ", stamp1, prompt);
|
||||
} else {
|
||||
snprintf(buffer, sizeof buffer, "%s %2.0d| ", stamp1, id);
|
||||
}
|
||||
prompt = buffer;
|
||||
} else if (id == NOID) {
|
||||
if (!prompt) {
|
||||
prompt = "";
|
||||
} else {
|
||||
@@ -125,7 +137,7 @@ void WriteToCommandLogId(char *prompt, int id, char *text)
|
||||
snprintf(buffer, sizeof buffer, "sock %d>%s ", id, prompt);
|
||||
}
|
||||
prompt = buffer;
|
||||
} else {
|
||||
} else if (iCompact > 1) {
|
||||
if (id != lastId) {
|
||||
lastId = id;
|
||||
doStampId = 1;
|
||||
@@ -138,7 +150,7 @@ void WriteToCommandLogId(char *prompt, int id, char *text)
|
||||
}
|
||||
}
|
||||
|
||||
if (iCompact > 0) { /* write time stamp */
|
||||
if (iCompact > 1) { /* write time stamp */
|
||||
if (now / iCompact != lastStamp / iCompact) {
|
||||
doStamp = 1;
|
||||
doStampId = 1;
|
||||
|
||||
Reference in New Issue
Block a user