Restored ability to remove syslog from CFLAGS in Makefile

pull/137/head
Benjamin Runnels 9 years ago
parent 154c64a454
commit 41d42babe6
  1. 7
      esp-link.vcxproj
  2. 4
      esp-link/cgiservices.c
  3. 10
      esp-link/main.c
  4. 6
      serial/serbridge.c

@ -111,8 +111,14 @@
<None Include="html\ui.js" /> <None Include="html\ui.js" />
<None Include="html\wifi\wifi.html" /> <None Include="html\wifi\wifi.html" />
<None Include="html\wifi\wifi.js" /> <None Include="html\wifi\wifi.js" />
<None Include="html\wifi\wifiAp.html" />
<None Include="html\wifi\wifiAp.js" />
<None Include="html\wifi\wifiSta.html" />
<None Include="html\wifi\wifiSta.js" />
<None Include="Makefile" /> <None Include="Makefile" />
<None Include="README.adoc" />
<None Include="README.md" /> <None Include="README.md" />
<None Include="syslog\syslog.md" />
<None Include="wiflash" /> <None Include="wiflash" />
<None Include="WINDOWS.md" /> <None Include="WINDOWS.md" />
</ItemGroup> </ItemGroup>
@ -122,6 +128,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Image Include="html\favicon.ico" /> <Image Include="html\favicon.ico" />
<Image Include="html\wifi\icons.png" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{A92F0CAA-F89B-4F78-AD2A-A042429BD87F}</ProjectGuid> <ProjectGuid>{A92F0CAA-F89B-4F78-AD2A-A042429BD87F}</ProjectGuid>

@ -2,7 +2,9 @@
#include "cgiwifi.h" #include "cgiwifi.h"
#include "cgi.h" #include "cgi.h"
#include "config.h" #include "config.h"
#ifdef SYSLOG
#include "syslog.h" #include "syslog.h"
#endif
#include "sntp.h" #include "sntp.h"
#include "cgimqtt.h" #include "cgimqtt.h"
@ -152,7 +154,9 @@ int ICACHE_FLASH_ATTR cgiServicesSet(HttpdConnData *connData) {
if (syslog < 0) return HTTPD_CGI_DONE; if (syslog < 0) return HTTPD_CGI_DONE;
if (syslog > 0) { if (syslog > 0) {
#ifdef SYSLOG
syslog_init(flashConfig.syslog_host); syslog_init(flashConfig.syslog_host);
#endif
} }
int8_t sntp = 0; int8_t sntp = 0;

@ -29,13 +29,23 @@
#include "config.h" #include "config.h"
#include "log.h" #include "log.h"
#include "gpio.h" #include "gpio.h"
#ifdef SYSLOG
#include "syslog.h" #include "syslog.h"
#endif
#include "cgiservices.h" #include "cgiservices.h"
#ifdef SYSLOG
#define NOTICE(format, ...) do { \ #define NOTICE(format, ...) do { \
LOG_NOTICE(format, ## __VA_ARGS__ ); \ LOG_NOTICE(format, ## __VA_ARGS__ ); \
os_printf(format "\n", ## __VA_ARGS__); \ os_printf(format "\n", ## __VA_ARGS__); \
} while ( 0 ) } while ( 0 )
#else
#define NOTICE(format, ...) do { \
os_printf(format "\n", ## __VA_ARGS__); \
} while ( 0 )
#endif
/* /*
This is the main url->function dispatching data struct. This is the main url->function dispatching data struct.

@ -10,7 +10,9 @@
#include "console.h" #include "console.h"
#include "slip.h" #include "slip.h"
#include "cmd.h" #include "cmd.h"
#ifdef SYSLOG
#include "syslog.h" #include "syslog.h"
#endif
#define SKIP_AT_RESET #define SKIP_AT_RESET
@ -405,12 +407,16 @@ serbridgeConnectCb(void *arg)
#ifdef SERBR_DBG #ifdef SERBR_DBG
os_printf("Accept port %d, conn=%p, pool slot %d\n", conn->proto.tcp->local_port, conn, i); os_printf("Accept port %d, conn=%p, pool slot %d\n", conn->proto.tcp->local_port, conn, i);
#endif #endif
#ifdef SYSLOG
syslog(SYSLOG_FAC_USER, SYSLOG_PRIO_NOTICE, "esp-link", "Accept port %d, conn=%p, pool slot %d\n", conn->proto.tcp->local_port, conn, i); syslog(SYSLOG_FAC_USER, SYSLOG_PRIO_NOTICE, "esp-link", "Accept port %d, conn=%p, pool slot %d\n", conn->proto.tcp->local_port, conn, i);
#endif
if (i==MAX_CONN) { if (i==MAX_CONN) {
#ifdef SERBR_DBG #ifdef SERBR_DBG
os_printf("Aiee, conn pool overflow!\n"); os_printf("Aiee, conn pool overflow!\n");
#endif #endif
#ifdef SYSLOG
syslog(SYSLOG_FAC_USER, SYSLOG_PRIO_WARNING, "esp-link", "Aiee, conn pool overflow!\n"); syslog(SYSLOG_FAC_USER, SYSLOG_PRIO_WARNING, "esp-link", "Aiee, conn pool overflow!\n");
#endif
espconn_disconnect(conn); espconn_disconnect(conn);
return; return;
} }

Loading…
Cancel
Save