test_mode no
#test_mode yes
+disable_syslog yes
+
# Used to set dispense into a dummy mode when the coke machine is out of action
# and we're dispensing drinks from the fridge (or manually)
coke_dummy_mode no
#define COKEBANK_SALES_ACCT ">sales" //!< Sales made into
#define COKEBANK_SALES_PREFIX ">sales:" //!< Sales made into
-#define COKEBANK_ADDSRC_ACCT ">delta" //!< Credit taken out of
+#define COKEBANK_ADDSRC_ACCT ">additions" //!< Credit taken out of
#define COKEBANK_DEBT_ACCT ">countersum" //!< Balancing account (causes sum to be 0)
#define COKEBANK_FREE_ACCT ">freeitems" //!< ODay drink costs taken out of
#define COKEBANK_DONATE_ACCT ">donations" //!< Donations go here
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#include <stdbool.h>
#include "common.h"
#include <syslog.h>
+// === GLOBALS ===
+bool gbSyslogEnabled = true;
+
// === CODE ==
void Log_Error(const char *Format, ...)
{
va_list args;
va_start(args, Format);
- vsyslog(LOG_WARNING, Format, args);
+ if( gbSyslogEnabled )
+ {
+ vsyslog(LOG_WARNING, Format, args);
+ }
+ else
+ {
+ fprintf(stderr, "WARNING: ");
+ vfprintf(stderr, Format, args);
+ fprintf(stderr, "\n");
+ }
va_end(args);
}
va_list args;
va_start(args, Format);
- vsyslog(LOG_INFO, Format, args);
+ if( gbSyslogEnabled )
+ {
+ vsyslog(LOG_INFO, Format, args);
+ }
+ else
+ {
+ fprintf(stderr, "WARNING: ");
+ vfprintf(stderr, Format, args);
+ fprintf(stderr, "\n");
+ }
va_end(args);
}
*/
#include <stdlib.h>
#include <stdio.h>
+#include <stdbool.h>
#include <string.h>
#include <signal.h>
#include "common.h"
extern const char *gsItemListFile;
extern const char *gsCoke_ModbusAddress;
extern const char *gsDoor_SerialPort;
+extern bool gbSyslogEnabled;
// === PROTOTYPES ===
void *Periodic_Thread(void *Unused);
gsItemListFile = Config_GetValue("items_file", 0);
gbNoCostMode = (Config_GetValue_Bool("test_mode", 0) == 1);
+ gbSyslogEnabled = (Config_GetValue_Bool("disable_syslog", 0) == 0);
signal(SIGINT, sigint_handler);
signal(SIGTERM, sigint_handler);