#include <sys/stat.h>
#include <linux/input.h>
#include <util.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include "accel.h"
*/
#include <sensor/sensor_hal.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include <vector>
#include "accel/accel.h"
#include <sys/stat.h>
#include <linux/input.h>
#include <util.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include "proxi.h"
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef _SENSOR_LOG_H_
+#define _SENSOR_LOG_H_
+
+#include <dlog.h>
+
+#if !defined(NAME_MAX)
+#define NAME_MAX 256
+#endif
+
+#define SENSOR_TYPE_SHIFT 16
+
+enum sf_log_type {
+ SF_LOG_PRINT_FILE = 1,
+ SF_LOG_SYSLOG = 2,
+ SF_LOG_DLOG = 3,
+};
+
+enum sf_priority_type {
+ SF_LOG_ERR = 1,
+ SF_LOG_DBG = 2,
+ SF_LOG_INFO = 3,
+ SF_LOG_WARN = 4,
+};
+
+#define MICROSECONDS(tv) ((tv.tv_sec * 1000000ll) + tv.tv_usec)
+
+//for new log system - dlog
+#ifdef LOG_TAG
+ #undef LOG_TAG
+#endif
+#define LOG_TAG "SENSOR"
+
+#ifdef _DEBUG
+#define DBG SLOGD
+#else
+#define DBG(...) do{} while(0)
+#endif
+
+#define ERR SLOGE
+#define WARN SLOGW
+#define INFO SLOGI
+#define _E ERR
+#define _W WARN
+#define _I INFO
+#define _D DBG
+
+#define _ERRNO(errno, tag, fmt, arg...) do { \
+ char buf[1024]; \
+ char *error = strerror_r(errno, buf, 1024); \
+ if (!error) { \
+ _E("Failed to strerror_r()"); \
+ break; \
+ } \
+ tag(fmt" (%s[%d])", ##arg, error, errno); \
+ } while (0)
+
+#if defined(_DEBUG)
+# define warn_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ DBG("(%s) -> " fmt, #expr, ##arg); \
+ } \
+ } while (0)
+# define ret_if(expr) do { \
+ if(expr) { \
+ DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+ } while (0)
+# define retv_if(expr, val) do { \
+ if(expr) { \
+ DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+ } while (0)
+# define retm_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ ERR(fmt, ##arg); \
+ DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+ } while (0)
+# define retvm_if(expr, val, fmt, arg...) do { \
+ if(expr) { \
+ ERR(fmt, ##arg); \
+ DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+ } while (0)
+
+#else
+# define warn_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ ERR(fmt, ##arg); \
+ } \
+ } while (0)
+# define ret_if(expr) do { \
+ if(expr) { \
+ return; \
+ } \
+ } while (0)
+# define retv_if(expr, val) do { \
+ if(expr) { \
+ return (val); \
+ } \
+ } while (0)
+# define retm_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ ERR(fmt, ##arg); \
+ return; \
+ } \
+ } while (0)
+# define retvm_if(expr, val, fmt, arg...) do { \
+ if(expr) { \
+ ERR(fmt, ##arg); \
+ return (val); \
+ } \
+ } while (0)
+
+#endif
+
+#endif /* _SENSOR_LOG_H_ */
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef _SENSOR_LOG_H_
-#define _SENSOR_LOG_H_
-
-#include <dlog.h>
-
-#if !defined(NAME_MAX)
-#define NAME_MAX 256
-#endif
-
-#define SENSOR_TYPE_SHIFT 16
-
-enum sf_log_type {
- SF_LOG_PRINT_FILE = 1,
- SF_LOG_SYSLOG = 2,
- SF_LOG_DLOG = 3,
-};
-
-enum sf_priority_type {
- SF_LOG_ERR = 1,
- SF_LOG_DBG = 2,
- SF_LOG_INFO = 3,
- SF_LOG_WARN = 4,
-};
-
-#define MICROSECONDS(tv) ((tv.tv_sec * 1000000ll) + tv.tv_usec)
-
-//for new log system - dlog
-#ifdef LOG_TAG
- #undef LOG_TAG
-#endif
-#define LOG_TAG "SENSOR"
-
-#ifdef _DEBUG
-#define DBG SLOGD
-#else
-#define DBG(...) do{} while(0)
-#endif
-
-#define ERR SLOGE
-#define WARN SLOGW
-#define INFO SLOGI
-#define _E ERR
-#define _W WARN
-#define _I INFO
-#define _D DBG
-
-#define _ERRNO(errno, tag, fmt, arg...) do { \
- char buf[1024]; \
- char *error = strerror_r(errno, buf, 1024); \
- if (!error) { \
- _E("Failed to strerror_r()"); \
- break; \
- } \
- tag(fmt" (%s[%d])", ##arg, error, errno); \
- } while (0)
-
-#if defined(_DEBUG)
-# define warn_if(expr, fmt, arg...) do { \
- if(expr) { \
- DBG("(%s) -> " fmt, #expr, ##arg); \
- } \
- } while (0)
-# define ret_if(expr) do { \
- if(expr) { \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return; \
- } \
- } while (0)
-# define retv_if(expr, val) do { \
- if(expr) { \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return (val); \
- } \
- } while (0)
-# define retm_if(expr, fmt, arg...) do { \
- if(expr) { \
- ERR(fmt, ##arg); \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return; \
- } \
- } while (0)
-# define retvm_if(expr, val, fmt, arg...) do { \
- if(expr) { \
- ERR(fmt, ##arg); \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return (val); \
- } \
- } while (0)
-
-#else
-# define warn_if(expr, fmt, arg...) do { \
- if(expr) { \
- ERR(fmt, ##arg); \
- } \
- } while (0)
-# define ret_if(expr) do { \
- if(expr) { \
- return; \
- } \
- } while (0)
-# define retv_if(expr, val) do { \
- if(expr) { \
- return (val); \
- } \
- } while (0)
-# define retm_if(expr, fmt, arg...) do { \
- if(expr) { \
- ERR(fmt, ##arg); \
- return; \
- } \
- } while (0)
-# define retvm_if(expr, val, fmt, arg...) do { \
- if(expr) { \
- ERR(fmt, ##arg); \
- return (val); \
- } \
- } while (0)
-
-#endif
-
-#endif /* _SENSOR_LOG_H_ */
*/
#include <gio/gio.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include "dbus_util.h"
void init_dbus(void)
*/
#include <algorithm>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include "sensorhub.h"
#include "sensorhub_controller.h"
#include <sys/ioctl.h>
#include <fstream>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include <util.h>
#include "sensorhub_controller.h"
#include <map>
#include <vector>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include "sensorhub_controller.h"
#include "sensorhub_sensor.h"
*
*/
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include <time.h>
#include "sensorhub_controller.h"
#include "sensorhub_sensor.h"
*
*/
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include "dbus_util.h"
#include "system_state.h"
#include <algorithm>
#include <sensor/sensor_hal.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
#include "sensorhub_manager.h"
#include "system_state.h"
#include <string.h>
#include <fstream>
#include <util.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
using std::ifstream;
using std::ofstream;