The main eeze sensor log domain was EAPI as it was used in the modules as well.
(Gives some nice runtime error when loading the shared object). Switch to different
domains for the module and make the main domain private.
Spotted by zmike.
int _eeze_udev_log_dom = -1;
int _eeze_net_log_dom = -1;
-EAPI int _eeze_sensor_log_dom = -1;
+int _eeze_sensor_log_dom = -1;
int _eeze_init_count = 0;
static Eeze_Version _version = { VMAJ, VMIN, VMIC, VREV };
* fixed values for the data, but provides the correct timestamp value.
*/
+static int _eeze_sensor_fake_log_dom = -1;
+
+#ifdef ERR
+#undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_fake_log_dom, __VA_ARGS__)
+
Eeze_Sensor_Module *esensor_module;
Eina_Bool
Eina_Bool
sensor_fake_init(void)
{
+
+ _eeze_sensor_fake_log_dom = eina_log_domain_register("eeze_sensor_fake", EINA_COLOR_BLUE);
+ if (_eeze_sensor_fake_log_dom < 0)
+ {
+ EINA_LOG_ERR("Could not register 'eeze_sensor_fake' log domain.");
+ return EINA_FALSE;
+ }
+
/* Check to avoid multi-init */
if (esensor_module) return EINA_FALSE;
free(esensor_module);
esensor_module = NULL;
+
+ eina_log_domain_unregister(_eeze_sensor_fake_log_dom);
+ _eeze_sensor_fake_log_dom = -1;
}
EINA_MODULE_INIT(sensor_fake_init);
#include <Eeze_Sensor.h>
#include "eeze_sensor_private.h"
+static int _eeze_sensor_tizen_log_dom = -1;
+
+#ifdef ERR
+#undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_tizen_log_dom, __VA_ARGS__)
+
Eeze_Sensor_Module *esensor_module;
/* Tizen sensor handle */
sensor_h sensor_handle;
Eina_Bool
sensor_tizen_init(void)
{
+
+ _eeze_sensor_tizen_log_dom = eina_log_domain_register("eeze_sensor_tizen", EINA_COLOR_BLUE);
+ if (_eeze_sensor_tizen_log_dom < 0)
+ {
+ EINA_LOG_ERR("Could not register 'eeze_sensor_tizen' log domain.");
+ return EINA_FALSE;
+ }
+
/* Check to avoid multi-init */
if (esensor_module) return EINA_FALSE;
free(esensor_module);
esensor_module = NULL;
+
+ eina_log_domain_unregister(_eeze_sensor_tizen_log_dom);
+ _eeze_sensor_tizen_log_dom = -1;
}
EINA_MODULE_INIT(sensor_tizen_init);