|
@@ -79,7 +79,7 @@ void StartSystemTimeoutDet(unsigned char flag);
|
|
|
void StopSystemTimeoutDet();
|
|
|
void StartGunInfoTimeoutDet(unsigned char gunIndex, unsigned char flag);
|
|
|
void StopGunInfoTimeoutDet(unsigned char gunIndex);
|
|
|
-int StoreLogMsg_1(const char *fmt, ...);
|
|
|
+int StoreLogMsg(const char *fmt, ...);
|
|
|
unsigned long GetTimeoutValue(struct timeval _sour_time);
|
|
|
void gpio_set_value(unsigned int gpio, unsigned int value);
|
|
|
void PRINTF_FUNC(char *string, ...);
|
|
@@ -95,9 +95,9 @@ int DB_Insert_Record(sqlite3 *db, int gun_index);
|
|
|
int DB_Update_Operactive(sqlite3 *db, uint8_t gun_index, uint8_t IsAvailable);
|
|
|
int DB_Get_Operactive(sqlite3 *db, uint8_t gun_index);
|
|
|
|
|
|
-#define DEBUG_INFO_MSG(format, args...) StoreLogMsg_1("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
-#define DEBUG_WARN_MSG(format, args...) StoreLogMsg_1("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
-#define DEBUG_ERROR_MSG(format, args...) StoreLogMsg_1("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
+#define DEBUG_INFO_MSG(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
+#define DEBUG_WARN_MSG(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
+#define DEBUG_ERROR_MSG(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
|
|
|
struct SysConfigAndInfo *ShmSysConfigAndInfo;
|
|
|
struct StatusCodeData *ShmStatusCodeData;
|
|
@@ -429,7 +429,7 @@ int InitWatchDog()
|
|
|
return fd;
|
|
|
}
|
|
|
|
|
|
-int StoreLogMsg_1(const char *fmt, ...)
|
|
|
+int StoreLogMsg(const char *fmt, ...)
|
|
|
{
|
|
|
char Buf[4096+256];
|
|
|
char buffer[4096];
|
|
@@ -446,11 +446,20 @@ int StoreLogMsg_1(const char *fmt, ...)
|
|
|
SeqEndTime.time = time(NULL);
|
|
|
tm=localtime(&SeqEndTime.time);
|
|
|
|
|
|
- sprintf(Buf,"echo \"%04d-%02d-%02d %02d:%02d:%02d.%03d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
|
|
|
- tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,SeqEndTime.millitm,
|
|
|
- buffer,
|
|
|
- tm->tm_year+1900,tm->tm_mon+1);
|
|
|
- system(Buf);
|
|
|
+ if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
|
|
|
+ {
|
|
|
+ sprintf(Buf,"%02d:%02d:%02d.%03d - %s",
|
|
|
+ tm->tm_hour,tm->tm_min,tm->tm_sec,SeqEndTime.millitm, buffer);
|
|
|
+ printf("%s \n", Buf);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sprintf(Buf,"echo \"%04d-%02d-%02d %02d:%02d:%02d.%03d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
|
|
|
+ tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,SeqEndTime.millitm,
|
|
|
+ buffer,
|
|
|
+ tm->tm_year+1900,tm->tm_mon+1);
|
|
|
+ system(Buf);
|
|
|
+ }
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
@@ -513,10 +522,7 @@ void PRINTF_FUNC(char *string, ...)
|
|
|
vsnprintf(buffer, sizeof(buffer), string, args);
|
|
|
va_end(args);
|
|
|
|
|
|
- if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
|
|
|
- printf("%s \n", buffer);
|
|
|
- else
|
|
|
- DEBUG_INFO_MSG("%s \n", buffer);
|
|
|
+ DEBUG_INFO_MSG("%s \n", buffer);
|
|
|
}
|
|
|
//==========================================
|
|
|
// Check interface status
|