various improvements

- use dig for resolving host names
- ascon.c: fix terminator parsing
- property callback: change property before callback
- logger.c:default for logger period must be the old value instead of 1
- add frappy type history writing
- increase max. logreader line length
- HIPNONE returns "null" with json protocol
- encode strings properly in formatNameValue
- fix memory leak in json2tcl
- scriptcontext: do not show debug messages when script starts with underscore or when the "send" property is empty
- scriptcontext: remove args for action timestamp
- scriptcontext: "que" function will replace an already queued action, e.g. for 'halt
- introduced updatestatus script
This commit is contained in:
2021-09-16 12:26:18 +02:00
parent 8de1fd4183
commit 61341b52f4
24 changed files with 2352 additions and 304 deletions

View File

@ -49,6 +49,12 @@ Logger *LoggerFind(const char *name)
return NULL;
}
/*--------------------------------------------------------------------------*/
Logger *LoggerList(void)
{
return list;
}
/*--------------------------------------------------------------------------*/
#define LASTLOGTXT "#last logging entry at:\n"
@ -158,8 +164,13 @@ int LoggerWrite0(Logger * log, time_t now, int period, char *value)
strftime(path + l, sizeof path - l, "%m-%d.log", &tm);
strftime(stim, sizeof stim, "#%Y-%m-%d %H:%M:%S", &tm);
if (period <= 0)
period = 1;
if (period <= 0) {
if (log->period > 0) {
period = log->period;
} else {
period = 1;
}
}
writeInfo = (tm.tm_isdst != lasttm.tm_isdst ||
tm.tm_yday != lasttm.tm_yday ||
(period != log->period && log->numeric));
@ -373,7 +384,7 @@ void LoggerKill(Logger * log)
}
/*--------------------------------------------------------------------------*/
static int LoggerMakeDir(char *path)
int LoggerMakeDir(char *path)
{
static char buffer[4096];
struct stat st;
@ -473,6 +484,10 @@ void LoggerFreeAll(void)
free(p->name);
if (p->old)
free(p->old);
if (p->secop_old)
free(p->secop_old);
if (p->secop_id)
free(p->secop_id);
free(p);
p = next;
}