Include outcode and continuation marker, move testlog test command up.

Moving the testlog command up reduces the dependency loops in servlog
This commit is contained in:
Douglas Clowes
2014-04-03 11:59:26 +11:00
parent bab07abab8
commit 79be4c9422
2 changed files with 53 additions and 27 deletions

View File

@@ -290,6 +290,32 @@ static int MacroFileEvalGlob(SConnection * pCon, SicsInterp * pInter, void *pDat
SCSendOK(pCon);
return rv;
}
/* Test of the logging facilities */
int testLogCmd(SConnection *pCon, SicsInterp *pInter, void *pData,
int argc, char *argv[]) {
char lbuf[2048];
char sbuf[1000];
int i;
SICSLogWrite("Multiline:\nLine 1\r\nLine 2\r\nLine 3\r\n", eStatus);
memset(lbuf, 0, sizeof(lbuf));
memset(sbuf, ' ', sizeof(sbuf));
SICSLogPrintf(eStatus, "Hexlog %d all zero bytes", sizeof(lbuf));
SICSLogWriteHex(lbuf, sizeof(lbuf), eStatus);
for (i = 0; i <= 128; ++i)
sbuf[i] = sbuf[sizeof(sbuf) - 1 - i] = i;
sbuf[sizeof(sbuf) / 2] = '!';
SICSLogPrintf(eStatus, "Hexlog %d mid space bytes", sizeof(sbuf));
SICSLogWriteHex(sbuf, sizeof(sbuf), eStatus);
for (i = 0; i < 1000; ++i)
sbuf[i] = ' ' + (i % 96);
sbuf[sizeof(sbuf) - 1] = '\0';
SICSLogWrite("Very long line 1000 bytes", eStatus);
SICSLogWrite(sbuf, eStatus);
SCSendOK(pCon);
return OKOK;
}
void SiteInit(void) {
int NetWatchInit(void);
NetWatchInit();