aqhome-nodes: log outbound messages. too.
This commit is contained in:
@@ -1046,6 +1046,30 @@ void _setDeviceName(AQH_VALUE *value, uint32_t uid)
|
||||
|
||||
|
||||
|
||||
void AQH_NodeServer_WriteTtyMsgToLogFile(AQH_OBJECT *o, const AQH_MESSAGE *msg, const char *txt)
|
||||
{
|
||||
if (o && msg) {
|
||||
AQH_NODE_SERVER *xo;
|
||||
|
||||
xo=GWEN_INHERIT_GETDATA(AQH_OBJECT, AQH_NODE_SERVER, o);
|
||||
if (xo && xo->logFile) {
|
||||
GWEN_BUFFER *dbuf;
|
||||
GWEN_TIME *ti;
|
||||
|
||||
dbuf=GWEN_Buffer_new(0, 256, 0, 1);
|
||||
ti=GWEN_CurrentTime();
|
||||
GWEN_Time_toString(ti, "YYYY-MM-DD hh:mm:ss ", dbuf);
|
||||
GWEN_Time_free(ti);
|
||||
ti=NULL;
|
||||
AQH_NodeMessage_DumpSpecificToBuffer(msg, dbuf, txt?txt:"");
|
||||
_writeToLogFile(xo->logFile, GWEN_Buffer_GetStart(dbuf));
|
||||
GWEN_Buffer_free(dbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _writeTtyMsgToLogFile(AQH_NODE_SERVER *xo, const AQH_MESSAGE *msg)
|
||||
{
|
||||
if (xo->logFile) {
|
||||
|
||||
Reference in New Issue
Block a user