109 void twLog(
enum LogLevel level,
const char *format, ...) __attribute__((format(printf, 2, 3)));
122 void twLogHexString(
const char * msg,
char * preamble,
size_t length);
char * twCodeToString(enum msgCodeEnum m)
Helper function to convert a msgCodeEnum to a string.
Definition: twLogger.c:111
char isVerbose
Definition: twLogger.h:44
void twLogHexString(const char *msg, char *preamble, size_t length)
Logs a hex string message.
Definition: twLogger.c:462
void(* log_function)(enum LogLevel level, const char *timestamp, const char *message)
For log message level enumeration see twDefinitions.h.
Definition: twLogger.h:36
TW_MUTEX mtx
Definition: twLogger.h:46
ThingWorx C SDK error code definitions.
char * twCharacteristicToString(enum characteristicEnum m)
Helper function to convert a characteristicEnum to a string.
Definition: twLogger.c:179
#define TW_MUTEX
For Linux builds a TW_MUTEX is a pthread_mutex_t.
Definition: twLinux-openssl.h:81
int twLogger_Delete()
Frees all memory associated with the twLogger singleton.
Definition: twLogger.c:53
int twLogger_SetIsVerbose(char val)
Sets the twLogger::isVerbose flag of the twLogger singleton.
Definition: twLogger.c:80
Wrappers for OS-specific functionality.
ThingWorx Logger singleton structure definition.
Definition: twLogger.h:41
log_function f
Definition: twLogger.h:43
int twLogger_SetFunction(log_function f)
Sets the ::twLogger#log_function of the twLogger singleton.
Definition: twLogger.c:72
LogLevel
Definition: twDefinitions.h:209
struct twLogger twLogger
ThingWorx Logger singleton structure definition.
entityTypeEnum
Definition: twDefinitions.h:114
msgCodeEnum
Enumeration of HTTP message codes.
Definition: twDefinitions.h:74
char * buffer
Definition: twLogger.h:45
characteristicEnum
Definition: twDefinitions.h:147
twLogger * twLogger_Instance()
Gets a pointer to the twLogger singleton and creates a new one if it hasn't been created already...
Definition: twLogger.c:39
int twLogger_SetLevel(enum LogLevel level)
Sets the ::twLogger#LogLevel of the twLogger singleton.
Definition: twLogger.c:64
enum LogLevel level
Definition: twLogger.h:42
void twLogMessage(void *m, char *preamble)
Logs a generic string message.
Definition: twLogger.c:418
void twLog(enum LogLevel level, const char *format,...)
Logs a message.
Definition: twLogger.c:88
char * twEntityToString(enum entityTypeEnum m)
Helper function to convert a entityTypeEnum to a string.
Definition: twLogger.c:166