Files
sics/logger.h
zolliker 61341b52f4 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
2021-09-16 12:26:18 +02:00

49 lines
1.2 KiB
C

/*---------------------------------------------------------------------------
logger.h
Markus Zolliker, Sept 2004
----------------------------------------------------------------------------
*/
#ifndef LOGGER_H
#define LOGGER_H
#include <time.h>
typedef struct Logger {
/* public */
char *name;
int numeric;
int period;
int exact;
void *histWriter;
char *secop_old;
char *secop_id;
/* private: */
char *old;
int oldsize;
time_t last, lastWrite, omitTime;
float omitValue;
struct Logger *next;
int category; /* 0: unimportant, 1: important */
} Logger;
Logger *LoggerMake(char *name, int period, int exact);
void LoggerKill(Logger * log);
int LoggerWrite(Logger * log, time_t now, int period, char *value);
char *LoggerName(Logger * log);
void LoggerSetNumeric(Logger * log, int numeric);
time_t LoggerSetDir(char *dirarg);
time_t LoggerGetLastLife(char *dirarg);
void LoggerWriteOld(Logger * log, time_t now);
time_t LoggerLastTime(Logger * log);
int LoggerPeriod(Logger * log);
void LoggerChange(Logger * log, int period, char *newname);
int LoggerVarPath(char *dir, char *path, int pathLen, char *name,
struct tm *t);
void LoggerFreeAll(void);
int LoggerMakeDir(char *path);
Logger *LoggerList(void);
#endif