summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2020-03-23 17:46:10 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2020-03-24 12:24:07 +0100
commit912fbe79a2f3ee56f0e2c5e1fe5270cc12d64227 (patch)
treeee82e5bbbfe31100bafb396355003ad57d9a466e
parent9da0235d74637b3ee0049eddd1a3ef2c44a3849e (diff)
exactness: switch from homegrown debug printf to eina_log
Use a full eina_log domain here for each executable. No need to have a own half baked ex_printf version here for such things. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11558
-rw-r--r--src/bin/exactness/common.c13
-rw-r--r--src/bin/exactness/common.h1
-rw-r--r--src/bin/exactness/exactness.c2
-rw-r--r--src/bin/exactness/injector.c39
-rw-r--r--src/bin/exactness/player.c63
-rw-r--r--src/bin/exactness/recorder.c25
6 files changed, 78 insertions, 65 deletions
diff --git a/src/bin/exactness/common.c b/src/bin/exactness/common.c
index 5646f4c3bb..72d02116b1 100644
--- a/src/bin/exactness/common.c
+++ b/src/bin/exactness/common.c
@@ -4,19 +4,6 @@
4 4
5#include "common.h" 5#include "common.h"
6 6
7static int _verbose = 0;
8
9void
10ex_printf(int verbose, const char *fmt, ...)
11{
12 va_list ap;
13 if (!_verbose || verbose > _verbose) return;
14
15 va_start(ap, fmt);
16 vprintf(fmt, ap);
17 va_end(ap);
18}
19
20int 7int
21ex_prg_invoke(const char *full_path, int argc, char **argv, Eina_Bool player) 8ex_prg_invoke(const char *full_path, int argc, char **argv, Eina_Bool player)
22{ 9{
diff --git a/src/bin/exactness/common.h b/src/bin/exactness/common.h
index b002a404c0..08a59ad935 100644
--- a/src/bin/exactness/common.h
+++ b/src/bin/exactness/common.h
@@ -276,6 +276,5 @@ Exactness_Unit *exactness_unit_file_read(const char *filename);
276Eina_Bool exactness_unit_file_write(Exactness_Unit *unit, const char *filename); 276Eina_Bool exactness_unit_file_write(Exactness_Unit *unit, const char *filename);
277void exactness_image_free(Exactness_Image *img); 277void exactness_image_free(Exactness_Image *img);
278 278
279void ex_printf(int verbose, const char *fmt, ...);
280int ex_prg_invoke(const char *full_path, int argc, char **argv, Eina_Bool player); 279int ex_prg_invoke(const char *full_path, int argc, char **argv, Eina_Bool player);
281Eina_Stringshare *ex_prg_full_path_guess(const char *prg); 280Eina_Stringshare *ex_prg_full_path_guess(const char *prg);
diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c
index 9fdd0066f5..3a9b8cde5c 100644
--- a/src/bin/exactness/exactness.c
+++ b/src/bin/exactness/exactness.c
@@ -255,7 +255,7 @@ ok:
255 } 255 }
256 strncpy(buf, eina_strbuf_string_get(sbuf), SCHEDULER_CMD_SIZE-1); 256 strncpy(buf, eina_strbuf_string_get(sbuf), SCHEDULER_CMD_SIZE-1);
257 eina_strbuf_free(sbuf); 257 eina_strbuf_free(sbuf);
258 ex_printf(1, "Command: %s\n", buf); 258 printf("Command: %s\n", buf);
259 return EINA_TRUE; 259 return EINA_TRUE;
260} 260}
261 261
diff --git a/src/bin/exactness/injector.c b/src/bin/exactness/injector.c
index c10c58b6b4..1482414740 100644
--- a/src/bin/exactness/injector.c
+++ b/src/bin/exactness/injector.c
@@ -15,6 +15,11 @@
15 15
16#include "common.h" 16#include "common.h"
17 17
18#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
19#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
20
21static int _log_domain = -1;
22
18static Eina_Stringshare *_src_filename = NULL; 23static Eina_Stringshare *_src_filename = NULL;
19static Exactness_Unit *_src_unit = NULL; 24static Exactness_Unit *_src_unit = NULL;
20static int _verbose = 0; 25static int _verbose = 0;
@@ -66,15 +71,15 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
66 { 71 {
67 case EXACTNESS_ACTION_MOUSE_IN: 72 case EXACTNESS_ACTION_MOUSE_IN:
68 { 73 {
69 ex_printf(1, "Mouse in\n"); 74 INF("Mouse in\n");
70 ex_printf(2, "%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas); 75 DBG("%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas);
71 eina_debug_session_send(_session, _cid, _mouse_in_op, &n_evas, sizeof(int)); 76 eina_debug_session_send(_session, _cid, _mouse_in_op, &n_evas, sizeof(int));
72 break; 77 break;
73 } 78 }
74 case EXACTNESS_ACTION_MOUSE_OUT: 79 case EXACTNESS_ACTION_MOUSE_OUT:
75 { 80 {
76 ex_printf(1, "Mouse out\n"); 81 INF("Mouse out\n");
77 ex_printf(2, "%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas); 82 DBG("%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas);
78 eina_debug_session_send(_session, _cid, _mouse_out_op, &n_evas, sizeof(int)); 83 eina_debug_session_send(_session, _cid, _mouse_out_op, &n_evas, sizeof(int));
79 break; 84 break;
80 } 85 }
@@ -83,8 +88,8 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
83 Exactness_Action_Mouse_Wheel *t = data; 88 Exactness_Action_Mouse_Wheel *t = data;
84 int len = 3*sizeof(int); 89 int len = 3*sizeof(int);
85 char *buf = malloc(len), *tmp = buf; 90 char *buf = malloc(len), *tmp = buf;
86 ex_printf(1, "Mouse wheel\n"); 91 INF("Mouse wheel\n");
87 ex_printf(2, "%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas); 92 DBG("%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas);
88 STORE_INT(tmp, n_evas); 93 STORE_INT(tmp, n_evas);
89 STORE_INT(tmp, t->direction); 94 STORE_INT(tmp, t->direction);
90 STORE_INT(tmp, t->z); 95 STORE_INT(tmp, t->z);
@@ -98,7 +103,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
98 Exactness_Action_Multi_Event *t = data; 103 Exactness_Action_Multi_Event *t = data;
99 int len = 5*sizeof(int)+7*sizeof(double)+sizeof(int); 104 int len = 5*sizeof(int)+7*sizeof(double)+sizeof(int);
100 char *buf = malloc(len), *tmp = buf; 105 char *buf = malloc(len), *tmp = buf;
101 ex_printf(2, "%s %s n_evas=<%d>\n", __func__, 106 DBG("%s %s n_evas=<%d>\n", __func__,
102 type == EXACTNESS_ACTION_MULTI_DOWN ? "evas_event_feed_multi_down" : 107 type == EXACTNESS_ACTION_MULTI_DOWN ? "evas_event_feed_multi_down" :
103 "evas_event_feed_multi_up", n_evas); 108 "evas_event_feed_multi_up", n_evas);
104 STORE_INT(tmp, n_evas); 109 STORE_INT(tmp, n_evas);
@@ -125,7 +130,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
125 Exactness_Action_Multi_Move *t = data; 130 Exactness_Action_Multi_Move *t = data;
126 int len = 4*sizeof(int)+7*sizeof(double); 131 int len = 4*sizeof(int)+7*sizeof(double);
127 char *buf = malloc(len), *tmp = buf; 132 char *buf = malloc(len), *tmp = buf;
128 ex_printf(2, "%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas); 133 DBG("%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas);
129 STORE_INT(tmp, n_evas); 134 STORE_INT(tmp, n_evas);
130 STORE_INT(tmp, t->d); 135 STORE_INT(tmp, t->d);
131 STORE_INT(tmp, t->x); 136 STORE_INT(tmp, t->x);
@@ -151,7 +156,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
151 len += t->string ? strlen(t->string) : 0; 156 len += t->string ? strlen(t->string) : 0;
152 len += t->compose ? strlen(t->compose) : 0; 157 len += t->compose ? strlen(t->compose) : 0;
153 char *buf = malloc(len), *tmp = buf; 158 char *buf = malloc(len), *tmp = buf;
154 ex_printf(2, "%s %s n_evas=<%d>\n", __func__, 159 DBG("%s %s n_evas=<%d>\n", __func__,
155 type == EXACTNESS_ACTION_KEY_DOWN ? "evas_event_feed_key_down " : 160 type == EXACTNESS_ACTION_KEY_DOWN ? "evas_event_feed_key_down " :
156 "evas_event_feed_key_up", n_evas); 161 "evas_event_feed_key_up", n_evas);
157 STORE_INT(tmp, n_evas); 162 STORE_INT(tmp, n_evas);
@@ -168,7 +173,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
168 } 173 }
169 case EXACTNESS_ACTION_TAKE_SHOT: 174 case EXACTNESS_ACTION_TAKE_SHOT:
170 { 175 {
171 ex_printf(2, "%s take shot n_evas=<%d>\n", __func__, n_evas); 176 DBG("%s take shot n_evas=<%d>\n", __func__, n_evas);
172 eina_debug_session_send(_session, _cid, _take_shot_op, &n_evas, sizeof(int)); 177 eina_debug_session_send(_session, _cid, _take_shot_op, &n_evas, sizeof(int));
173 break; 178 break;
174 } 179 }
@@ -179,7 +184,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
179 len += t->wdg_name ? strlen(t->wdg_name) : 0; 184 len += t->wdg_name ? strlen(t->wdg_name) : 0;
180 len += t->event_name ? strlen(t->event_name) : 0; 185 len += t->event_name ? strlen(t->event_name) : 0;
181 char *buf = malloc(len), *tmp = buf; 186 char *buf = malloc(len), *tmp = buf;
182 ex_printf(2, "%s %s\n", __func__, "EFL event"); 187 DBG("%s %s\n", __func__, "EFL event");
183 STORE_STRING(tmp, t->wdg_name); 188 STORE_STRING(tmp, t->wdg_name);
184 STORE_STRING(tmp, t->event_name); 189 STORE_STRING(tmp, t->event_name);
185 eina_debug_session_send(_session, _cid, _efl_event_op, buf, len); 190 eina_debug_session_send(_session, _cid, _efl_event_op, buf, len);
@@ -192,7 +197,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
192 int len = 0; 197 int len = 0;
193 len += t->wdg_name ? strlen(t->wdg_name) : 0; 198 len += t->wdg_name ? strlen(t->wdg_name) : 0;
194 char *buf = malloc(len), *tmp = buf; 199 char *buf = malloc(len), *tmp = buf;
195 ex_printf(2, "%s %s\n", __func__, "Click On"); 200 DBG("%s %s\n", __func__, "Click On");
196 STORE_STRING(tmp, t->wdg_name); 201 STORE_STRING(tmp, t->wdg_name);
197 eina_debug_session_send(_session, _cid, _click_on_op, buf, len); 202 eina_debug_session_send(_session, _cid, _click_on_op, buf, len);
198 free(buf); 203 free(buf);
@@ -200,7 +205,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
200 } 205 }
201 case EXACTNESS_ACTION_STABILIZE: 206 case EXACTNESS_ACTION_STABILIZE:
202 { 207 {
203 ex_printf(2, "%s stabilize\n", __func__); 208 DBG("%s stabilize\n", __func__);
204 eina_debug_session_send(_session, _cid, _stabilize_op, NULL, 0); 209 eina_debug_session_send(_session, _cid, _stabilize_op, NULL, 0);
205 break; 210 break;
206 } 211 }
@@ -235,7 +240,7 @@ _src_open()
235{ 240{
236 double diff_time = 0; /* Time to wait before feeding the first event */ 241 double diff_time = 0; /* Time to wait before feeding the first event */
237 242
238 ex_printf(2, "<%s> Source file is <%s>\n", __func__, _src_filename); 243 DBG("<%s> Source file is <%s>\n", __func__, _src_filename);
239 if (!strcmp(_src_filename + strlen(_src_filename) - 4,".exu")) 244 if (!strcmp(_src_filename + strlen(_src_filename) - 4,".exu"))
240 { 245 {
241 _src_unit = exactness_unit_file_read(_src_filename); 246 _src_unit = exactness_unit_file_read(_src_filename);
@@ -246,7 +251,7 @@ _src_open()
246 251
247 if (act->delay_ms) 252 if (act->delay_ms)
248 { 253 {
249 ex_printf(2, " Waiting <%f>\n", diff_time); 254 DBG(" Waiting <%f>\n", diff_time);
250 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); 255 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL);
251 } 256 }
252 else 257 else
@@ -350,6 +355,8 @@ int main(int argc, char **argv)
350 ECORE_GETOPT_VALUE_NONE 355 ECORE_GETOPT_VALUE_NONE
351 }; 356 };
352 357
358 _log_domain = eina_log_domain_register("exactness_injector", NULL);
359
353 if (!ecore_evas_init()) 360 if (!ecore_evas_init())
354 return EXIT_FAILURE; 361 return EXIT_FAILURE;
355 362
@@ -380,5 +387,7 @@ int main(int argc, char **argv)
380 elm_shutdown(); 387 elm_shutdown();
381end: 388end:
382 ecore_evas_shutdown(); 389 ecore_evas_shutdown();
390 eina_log_domain_unregister(_log_domain);
391 _log_domain = -1;
383 return real__; 392 return real__;
384} 393}
diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c
index 54514ae0be..1d27863299 100644
--- a/src/bin/exactness/player.c
+++ b/src/bin/exactness/player.c
@@ -34,6 +34,11 @@
34#define IMAGE_FILENAME_EXT ".png" 34#define IMAGE_FILENAME_EXT ".png"
35#define PAUSE_KEY_STR "F2" 35#define PAUSE_KEY_STR "F2"
36 36
37#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
38#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
39
40static int _log_domain = -1;
41
37typedef enum 42typedef enum
38{ 43{
39 FTYPE_UNKNOWN, 44 FTYPE_UNKNOWN,
@@ -136,7 +141,7 @@ _evas_render_post_cb(void *data EINA_UNUSED, const Efl_Event *event)
136 Eo *o = evas_object_image_add(event->object); 141 Eo *o = evas_object_image_add(event->object);
137 evas_object_image_size_set(o, ex_shot->w, ex_shot->h); 142 evas_object_image_size_set(o, ex_shot->w, ex_shot->h);
138 evas_object_image_data_set(o, ex_shot->pixels); 143 evas_object_image_data_set(o, ex_shot->pixels);
139 ex_printf(1, "Shot taken (%s).\n", filename); 144 INF("Shot taken (%s).\n", filename);
140 if (!evas_object_image_save(o, filename, NULL, NULL)) 145 if (!evas_object_image_save(o, filename, NULL, NULL))
141 { 146 {
142 printf("Cannot save widget to <%s>\n", filename); 147 printf("Cannot save widget to <%s>\n", filename);
@@ -148,7 +153,7 @@ _evas_render_post_cb(void *data EINA_UNUSED, const Efl_Event *event)
148 Exactness_Image *ex_img = e_data; 153 Exactness_Image *ex_img = e_data;
149 memcpy(ex_img, ex_shot, sizeof(Exactness_Image)); 154 memcpy(ex_img, ex_shot, sizeof(Exactness_Image));
150 ex_shot->pixels = NULL; 155 ex_shot->pixels = NULL;
151 ex_printf(1, "Shot taken (in %s).\n", _dest); 156 INF("Shot taken (in %s).\n", _dest);
152 } 157 }
153 else if (_dest_type == FTYPE_REMOTE) 158 else if (_dest_type == FTYPE_REMOTE)
154 { 159 {
@@ -279,23 +284,23 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
279 { 284 {
280 case EXACTNESS_ACTION_MOUSE_IN: 285 case EXACTNESS_ACTION_MOUSE_IN:
281 { 286 {
282 ex_printf(1, "Mouse in\n"); 287 INF("Mouse in\n");
283 ex_printf(2, "%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas); 288 DBG("%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas);
284 if (e) evas_event_feed_mouse_in(e, time(NULL), NULL); 289 if (e) evas_event_feed_mouse_in(e, time(NULL), NULL);
285 break; 290 break;
286 } 291 }
287 case EXACTNESS_ACTION_MOUSE_OUT: 292 case EXACTNESS_ACTION_MOUSE_OUT:
288 { 293 {
289 ex_printf(1, "Mouse out\n"); 294 INF("Mouse out\n");
290 ex_printf(2, "%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas); 295 DBG("%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas);
291 if (e) evas_event_feed_mouse_out(e, time(NULL), NULL); 296 if (e) evas_event_feed_mouse_out(e, time(NULL), NULL);
292 break; 297 break;
293 } 298 }
294 case EXACTNESS_ACTION_MOUSE_WHEEL: 299 case EXACTNESS_ACTION_MOUSE_WHEEL:
295 { 300 {
296 Exactness_Action_Mouse_Wheel *t = data; 301 Exactness_Action_Mouse_Wheel *t = data;
297 ex_printf(1, "Mouse wheel\n"); 302 INF("Mouse wheel\n");
298 ex_printf(2, "%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas); 303 DBG("%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas);
299 if (e) evas_event_feed_mouse_wheel(e, t->direction, t->z, time(NULL), NULL); 304 if (e) evas_event_feed_mouse_wheel(e, t->direction, t->z, time(NULL), NULL);
300 305
301 break; 306 break;
@@ -303,7 +308,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
303 case EXACTNESS_ACTION_MULTI_DOWN: 308 case EXACTNESS_ACTION_MULTI_DOWN:
304 { 309 {
305 Exactness_Action_Multi_Event *t = data; 310 Exactness_Action_Multi_Event *t = data;
306 ex_printf(2, "%s evas_event_feed_multi_down n_evas=<%d>\n", __func__, n_evas); 311 DBG("%s evas_event_feed_multi_down n_evas=<%d>\n", __func__, n_evas);
307 if (!t->d) 312 if (!t->d)
308 { 313 {
309 if (e) evas_event_feed_mouse_down(e, t->b, t->flags, time(NULL), NULL); 314 if (e) evas_event_feed_mouse_down(e, t->b, t->flags, time(NULL), NULL);
@@ -322,7 +327,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
322 case EXACTNESS_ACTION_MULTI_UP: 327 case EXACTNESS_ACTION_MULTI_UP:
323 { 328 {
324 Exactness_Action_Multi_Event *t = data; 329 Exactness_Action_Multi_Event *t = data;
325 ex_printf(2, "%s evas_event_feed_multi_up n_evas=<%d>\n", __func__, n_evas); 330 DBG("%s evas_event_feed_multi_up n_evas=<%d>\n", __func__, n_evas);
326 if (!t->d) 331 if (!t->d)
327 { 332 {
328 if (e) evas_event_feed_mouse_up(e, t->b, t->flags, time(NULL), NULL); 333 if (e) evas_event_feed_mouse_up(e, t->b, t->flags, time(NULL), NULL);
@@ -341,7 +346,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
341 case EXACTNESS_ACTION_MULTI_MOVE: 346 case EXACTNESS_ACTION_MULTI_MOVE:
342 { 347 {
343 Exactness_Action_Multi_Move *t = data; 348 Exactness_Action_Multi_Move *t = data;
344 ex_printf(2, "%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas); 349 DBG("%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas);
345 if (!t->d) 350 if (!t->d)
346 { 351 {
347 if (e) evas_event_feed_mouse_move(e, t->x, t->y, time(NULL), NULL); 352 if (e) evas_event_feed_mouse_move(e, t->x, t->y, time(NULL), NULL);
@@ -364,7 +369,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
364 case EXACTNESS_ACTION_KEY_DOWN: 369 case EXACTNESS_ACTION_KEY_DOWN:
365 { 370 {
366 Exactness_Action_Key_Down_Up *t = data; 371 Exactness_Action_Key_Down_Up *t = data;
367 ex_printf(2, "%s evas_event_feed_key_down n_evas=<%d>\n", __func__, n_evas); 372 DBG("%s evas_event_feed_key_down n_evas=<%d>\n", __func__, n_evas);
368 if (e) 373 if (e)
369 evas_event_feed_key_down_with_keycode(e, 374 evas_event_feed_key_down_with_keycode(e,
370 t->keyname, t->key, t->string, 375 t->keyname, t->key, t->string,
@@ -374,7 +379,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
374 case EXACTNESS_ACTION_KEY_UP: 379 case EXACTNESS_ACTION_KEY_UP:
375 { 380 {
376 Exactness_Action_Key_Down_Up *t = data; 381 Exactness_Action_Key_Down_Up *t = data;
377 ex_printf(2, "%s evas_event_feed_key_up n_evas=<%d>\n", __func__, n_evas); 382 DBG("%s evas_event_feed_key_up n_evas=<%d>\n", __func__, n_evas);
378 if (e) evas_event_feed_key_up_with_keycode(e, 383 if (e) evas_event_feed_key_up_with_keycode(e,
379 t->keyname, t->key, t->string, 384 t->keyname, t->key, t->string,
380 t->compose, time(NULL), NULL, t->keycode); 385 t->compose, time(NULL), NULL, t->keycode);
@@ -383,7 +388,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
383 } 388 }
384 case EXACTNESS_ACTION_TAKE_SHOT: 389 case EXACTNESS_ACTION_TAKE_SHOT:
385 { 390 {
386 ex_printf(2, "%s take shot n_evas=<%d>\n", __func__, n_evas); 391 DBG("%s take shot n_evas=<%d>\n", __func__, n_evas);
387 if (rect) evas_object_color_set(rect, 0, 0, 255, 255); 392 if (rect) evas_object_color_set(rect, 0, 0, 255, 255);
388 _cur_shot_id++; 393 _cur_shot_id++;
389 if (_dest_type != FTYPE_UNKNOWN && e) _shot_do(e); 394 if (_dest_type != FTYPE_UNKNOWN && e) _shot_do(e);
@@ -399,7 +404,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
399 Eo *o = efl_name_find(e, t->wdg_name); 404 Eo *o = efl_name_find(e, t->wdg_name);
400 if (o) 405 if (o)
401 { 406 {
402 ex_printf(2, "%s EFL event invoke %s on %s\n", 407 DBG("%s EFL event invoke %s on %s\n",
403 __func__, t->event_name, t->wdg_name); 408 __func__, t->event_name, t->wdg_name);
404 Efl_Event_Description d; 409 Efl_Event_Description d;
405 found = EINA_TRUE; 410 found = EINA_TRUE;
@@ -436,7 +441,7 @@ wdg_found:
436 Exactness_Action_Multi_Event *d_event = calloc(1, sizeof(*d_event)); 441 Exactness_Action_Multi_Event *d_event = calloc(1, sizeof(*d_event));
437 Exactness_Action *act, *prev_act = eina_list_data_get(_cur_event_list); 442 Exactness_Action *act, *prev_act = eina_list_data_get(_cur_event_list);
438 443
439 ex_printf(2, "%s click on %s\n", __func__, t->wdg_name); 444 DBG("%s click on %s\n", __func__, t->wdg_name);
440 act = calloc(1, sizeof(*act)); 445 act = calloc(1, sizeof(*act));
441 act->type = EXACTNESS_ACTION_MULTI_MOVE; 446 act->type = EXACTNESS_ACTION_MULTI_MOVE;
442 act->delay_ms = 100; 447 act->delay_ms = 100;
@@ -473,7 +478,7 @@ wdg_found:
473 } 478 }
474 case EXACTNESS_ACTION_STABILIZE: 479 case EXACTNESS_ACTION_STABILIZE:
475 { 480 {
476 ex_printf(2, "%s stabilize\n", __func__); 481 DBG("%s stabilize\n", __func__);
477 if (rect) evas_object_color_set(rect, 255, 165, 0, 255); 482 if (rect) evas_object_color_set(rect, 255, 165, 0, 255);
478 ecore_timer_add(0.1, _stabilization_timer_cb, NULL); 483 ecore_timer_add(0.1, _stabilization_timer_cb, NULL);
479 break; 484 break;
@@ -501,7 +506,7 @@ _feed_event_timer_cb(void *data EINA_UNUSED)
501 if (act->type != EXACTNESS_ACTION_STABILIZE) 506 if (act->type != EXACTNESS_ACTION_STABILIZE)
502 { 507 {
503 act = eina_list_data_get(_cur_event_list); 508 act = eina_list_data_get(_cur_event_list);
504 ex_printf(2, " %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0); 509 DBG(" %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0);
505 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); 510 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL);
506 } 511 }
507 } 512 }
@@ -515,7 +520,7 @@ _stabilization_timer_cb(void *data EINA_UNUSED)
515 Evas *e; 520 Evas *e;
516#define STAB_MAX 5 521#define STAB_MAX 5
517 static int need_more = STAB_MAX; 522 static int need_more = STAB_MAX;
518 ex_printf(2, "Not stable yet!\n"); 523 DBG("Not stable yet!\n");
519 EINA_LIST_FOREACH(_evas_list, itr, e) 524 EINA_LIST_FOREACH(_evas_list, itr, e)
520 { 525 {
521 if (!e) continue; 526 if (!e) continue;
@@ -539,7 +544,7 @@ _stabilization_timer_cb(void *data EINA_UNUSED)
539 if (_src_type != FTYPE_REMOTE && !_pause_request) 544 if (_src_type != FTYPE_REMOTE && !_pause_request)
540 { 545 {
541 Exactness_Action *act = eina_list_data_get(_cur_event_list); 546 Exactness_Action *act = eina_list_data_get(_cur_event_list);
542 ex_printf(2, " %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0); 547 DBG(" %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0);
543 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); 548 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL);
544 } 549 }
545 need_more = STAB_MAX; 550 need_more = STAB_MAX;
@@ -746,7 +751,7 @@ _src_feed(void *data EINA_UNUSED)
746 751
747 if (act && act->delay_ms) 752 if (act && act->delay_ms)
748 { 753 {
749 ex_printf(2, " Waiting <%f>\n", act->delay_ms / 1000.0); 754 DBG(" Waiting <%f>\n", act->delay_ms / 1000.0);
750 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); 755 ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL);
751 } 756 }
752 else 757 else
@@ -763,7 +768,7 @@ _src_open()
763 { 768 {
764 Eina_List *itr, *itr2; 769 Eina_List *itr, *itr2;
765 Exactness_Action *act; 770 Exactness_Action *act;
766 ex_printf(2, "<%s> Source file is <%s>\n", __func__, _src_filename); 771 DBG("<%s> Source file is <%s>\n", __func__, _src_filename);
767 if (_src_type == FTYPE_EXU) 772 if (_src_type == FTYPE_EXU)
768 { 773 {
769 _src_unit = exactness_unit_file_read(_src_filename); 774 _src_unit = exactness_unit_file_read(_src_filename);
@@ -832,10 +837,10 @@ _event_key_cb(void *data EINA_UNUSED, const Efl_Event *event)
832 if (!strcmp(key, PAUSE_KEY_STR) && efl_input_key_pressed_get(evk)) 837 if (!strcmp(key, PAUSE_KEY_STR) && efl_input_key_pressed_get(evk))
833 { 838 {
834 _pause_request = !_pause_request; 839 _pause_request = !_pause_request;
835 if (_pause_request) ex_printf(1, "Pausing scenario\n"); 840 if (_pause_request) INF("Pausing scenario\n");
836 else 841 else
837 { 842 {
838 ex_printf(1, "Playing scenario\n"); 843 INF("Playing scenario\n");
839 if (!_playing_status) 844 if (!_playing_status)
840 _feed_event_timer_cb(NULL); 845 _feed_event_timer_cb(NULL);
841 } 846 }
@@ -857,7 +862,7 @@ _my_evas_new(int w EINA_UNUSED, int h EINA_UNUSED)
857 e = _evas_new(); 862 e = _evas_new();
858 if (e) 863 if (e)
859 { 864 {
860 ex_printf(1, "New Evas\n"); 865 INF("New Evas\n");
861 _evas_list = eina_list_append(_evas_list, e); 866 _evas_list = eina_list_append(_evas_list, e);
862 efl_event_callback_array_add(e, _evas_callbacks(), NULL); 867 efl_event_callback_array_add(e, _evas_callbacks(), NULL);
863 } 868 }
@@ -927,6 +932,8 @@ int main(int argc, char **argv)
927 ECORE_GETOPT_VALUE_NONE 932 ECORE_GETOPT_VALUE_NONE
928 }; 933 };
929 934
935 _log_domain = eina_log_domain_register("exactness_player", NULL);
936
930 if (!ecore_evas_init()) 937 if (!ecore_evas_init())
931 return EXIT_FAILURE; 938 return EXIT_FAILURE;
932 939
@@ -1090,9 +1097,9 @@ int main(int argc, char **argv)
1090 { 1097 {
1091 argv[i - opt_args] = argv[0] + (argv[i] - argv[opt_args]); 1098 argv[i - opt_args] = argv[0] + (argv[i] - argv[opt_args]);
1092 } 1099 }
1093 ex_printf(1, "%s ", argv[i - opt_args]); 1100 INF("%s ", argv[i - opt_args]);
1094 } 1101 }
1095 ex_printf(1, "\n"); 1102 INF("\n");
1096 } 1103 }
1097 else 1104 else
1098 { 1105 {
@@ -1151,5 +1158,7 @@ int main(int argc, char **argv)
1151 1158
1152end: 1159end:
1153 ecore_evas_shutdown(); 1160 ecore_evas_shutdown();
1161 eina_log_domain_unregister(_log_domain);
1162 _log_domain = -1;
1154 return pret; 1163 return pret;
1155} 1164}
diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c
index 3ecaff7695..11f5bfb1ec 100644
--- a/src/bin/exactness/recorder.c
+++ b/src/bin/exactness/recorder.c
@@ -27,6 +27,11 @@
27#define SHOT_KEY_STR "F2" 27#define SHOT_KEY_STR "F2"
28#define SAVE_KEY_STR "F3" 28#define SAVE_KEY_STR "F3"
29 29
30#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
31#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
32
33static int _log_domain = -1;
34
30static const char *_out_filename = NULL; 35static const char *_out_filename = NULL;
31static const char *_test_name = NULL; 36static const char *_test_name = NULL;
32static int _verbose = 0; 37static int _verbose = 0;
@@ -73,7 +78,7 @@ _add_to_list(Exactness_Action_Type type, unsigned int n_evas, unsigned int times
73 prev_v->n_evas == n_evas && 78 prev_v->n_evas == n_evas &&
74 (!len || !memcmp(prev_v->data, data, len))) return; 79 (!len || !memcmp(prev_v->data, data, len))) return;
75 } 80 }
76 ex_printf(1, "Recording %s\n", _exactness_action_type_to_string_get(type)); 81 INF("Recording %s\n", _exactness_action_type_to_string_get(type));
77 Exactness_Action *act = malloc(sizeof(*act)); 82 Exactness_Action *act = malloc(sizeof(*act));
78 act->type = type; 83 act->type = type;
79 act->n_evas = n_evas; 84 act->n_evas = n_evas;
@@ -108,7 +113,7 @@ _event_pointer_cb(void *data, const Efl_Event *event)
108 113
109 if (!timestamp) return; 114 if (!timestamp) return;
110 115
111 ex_printf(2, "Calling \"%s\" timestamp=<%u>\n", _exactness_action_type_to_string_get(evt), timestamp); 116 DBG("Calling \"%s\" timestamp=<%u>\n", _exactness_action_type_to_string_get(evt), timestamp);
112 117
113 switch (action) 118 switch (action)
114 { 119 {
@@ -168,20 +173,20 @@ _event_key_cb(void *data, const Efl_Event *event)
168 { 173 {
169 if (!strcmp(key, _shot_key)) 174 if (!strcmp(key, _shot_key))
170 { 175 {
171 ex_printf(2, "Take Screenshot: %s timestamp=<%u>\n", __func__, timestamp); 176 DBG("Take Screenshot: %s timestamp=<%u>\n", __func__, timestamp);
172 _add_to_list(EXACTNESS_ACTION_TAKE_SHOT, n_evas, timestamp, NULL, 0); 177 _add_to_list(EXACTNESS_ACTION_TAKE_SHOT, n_evas, timestamp, NULL, 0);
173 return; 178 return;
174 } 179 }
175 if (!strcmp(key, STABILIZE_KEY_STR)) 180 if (!strcmp(key, STABILIZE_KEY_STR))
176 { 181 {
177 ex_printf(2, "Stabilize: %s timestamp=<%u>\n", __func__, timestamp); 182 DBG("Stabilize: %s timestamp=<%u>\n", __func__, timestamp);
178 _add_to_list(EXACTNESS_ACTION_STABILIZE, n_evas, timestamp, NULL, 0); 183 _add_to_list(EXACTNESS_ACTION_STABILIZE, n_evas, timestamp, NULL, 0);
179 return; 184 return;
180 } 185 }
181 if (!strcmp(key, SAVE_KEY_STR)) 186 if (!strcmp(key, SAVE_KEY_STR))
182 { 187 {
183 _output_write(); 188 _output_write();
184 ex_printf(2, "Save events: %s timestamp=<%u>\n", __func__, timestamp); 189 DBG("Save events: %s timestamp=<%u>\n", __func__, timestamp);
185 return; 190 return;
186 } 191 }
187 evt = EXACTNESS_ACTION_KEY_DOWN; 192 evt = EXACTNESS_ACTION_KEY_DOWN;
@@ -225,7 +230,7 @@ _my_evas_new(int w EINA_UNUSED, int h EINA_UNUSED)
225 e = _evas_new(); 230 e = _evas_new();
226 if (e) 231 if (e)
227 { 232 {
228 ex_printf(1, "New Evas\n"); 233 INF("New Evas\n");
229 _evas_list = eina_list_append(_evas_list, e); 234 _evas_list = eina_list_append(_evas_list, e);
230 efl_key_data_set(e, "__evas_id", (void *)(intptr_t)_last_evas_id++); 235 efl_key_data_set(e, "__evas_id", (void *)(intptr_t)_last_evas_id++);
231 efl_event_callback_array_add(e, _event_pointer_callbacks(), e); 236 efl_event_callback_array_add(e, _event_pointer_callbacks(), e);
@@ -277,6 +282,8 @@ int main(int argc, char **argv)
277 ECORE_GETOPT_VALUE_NONE 282 ECORE_GETOPT_VALUE_NONE
278 }; 283 };
279 284
285 _log_domain = eina_log_domain_register("exactness_recorder", NULL);
286
280 if (!ecore_evas_init()) 287 if (!ecore_evas_init())
281 return EXIT_FAILURE; 288 return EXIT_FAILURE;
282 289
@@ -385,9 +392,9 @@ int main(int argc, char **argv)
385 { 392 {
386 argv[i - opt_args] = argv[0] + (argv[i] - argv[opt_args]); 393 argv[i - opt_args] = argv[0] + (argv[i] - argv[opt_args]);
387 } 394 }
388 ex_printf(1, "%s ", argv[i - opt_args]); 395 INF("%s ", argv[i - opt_args]);
389 } 396 }
390 ex_printf(1, "\n"); 397 INF("\n");
391 398
392 if (!_shot_key) _shot_key = getenv("SHOT_KEY"); 399 if (!_shot_key) _shot_key = getenv("SHOT_KEY");
393 if (!_shot_key) _shot_key = SHOT_KEY_STR; 400 if (!_shot_key) _shot_key = SHOT_KEY_STR;
@@ -404,5 +411,7 @@ int main(int argc, char **argv)
404 411
405end: 412end:
406 ecore_evas_shutdown(); 413 ecore_evas_shutdown();
414 eina_log_domain_unregister(_log_domain);
415 _log_domain = -1;
407 return pret; 416 return pret;
408} 417}