summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-24 23:02:16 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-24 23:02:16 +0100
commitb01b2190179d5ee7db22047a7b4adfb1db07cac6 (patch)
treeaf3de618cc426407c9731eb53aa0dea0b758fc2e /src/bin
parent52ec7be0139046474bfd86a13b2cc3c8960936a1 (diff)
efreetd - log the cache runs and when they launch, show data, exit
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/efreet/efreetd.c2
-rw-r--r--src/bin/efreet/efreetd_cache.c34
2 files changed, 29 insertions, 7 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index a843d0688c..fbff09b58f 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -21,6 +21,7 @@
21 21
22int efreetd_log_dom = -1; 22int efreetd_log_dom = -1;
23Eina_Mempool *efreetd_mp_stat = NULL; 23Eina_Mempool *efreetd_mp_stat = NULL;
24FILE *efreetd_log_file = NULL;
24 25
25void 26void
26quit(void) 27quit(void)
@@ -72,6 +73,7 @@ main(int argc, char *argv[])
72 logf = fdopen(fd, "wb"); 73 logf = fdopen(fd, "wb");
73 if (!logf) goto tmp_error; 74 if (!logf) goto tmp_error;
74 eina_log_print_cb_set(eina_log_print_cb_file, logf); 75 eina_log_print_cb_set(eina_log_print_cb_file, logf);
76 efreetd_log_file = logf;
75 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR); 77 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);
76 if (efreetd_log_dom < 0) 78 if (efreetd_log_dom < 0)
77 { 79 {
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 2659a8d8c4..d7a7f2539f 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -19,6 +19,8 @@
19#include <sys/stat.h> 19#include <sys/stat.h>
20#include <unistd.h> 20#include <unistd.h>
21 21
22extern FILE *efreetd_log_file;
23
22static Eina_Hash *icon_change_monitors = NULL; 24static Eina_Hash *icon_change_monitors = NULL;
23static Eina_Hash *icon_change_monitors_mon = NULL; 25static Eina_Hash *icon_change_monitors_mon = NULL;
24static Eina_Hash *desktop_change_monitors = NULL; 26static Eina_Hash *desktop_change_monitors = NULL;
@@ -376,10 +378,13 @@ icon_cache_update_cache_cb(void *data EINA_UNUSED)
376 if (icon_flush) 378 if (icon_flush)
377 eina_strbuf_append(file, " -f"); 379 eina_strbuf_append(file, " -f");
378 icon_flush = EINA_FALSE; 380 icon_flush = EINA_FALSE;
379 icon_cache_exe = 381 fprintf(efreetd_log_file, "[%09.3f] Run:\n %s\n", ecore_time_get(),
380 ecore_exe_pipe_run(eina_strbuf_string_get(file), ECORE_EXE_PIPE_READ | 382 eina_strbuf_string_get(file));
381 ECORE_EXE_PIPE_READ_LINE_BUFFERED, 383 fflush(efreetd_log_file);
382 NULL); 384 icon_cache_exe = ecore_exe_pipe_run
385 (eina_strbuf_string_get(file),
386 ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_READ_LINE_BUFFERED,
387 NULL);
383 388
384 eina_strbuf_free(file); 389 eina_strbuf_free(file);
385 390
@@ -424,10 +429,13 @@ desktop_cache_update_cache_cb(void *data EINA_UNUSED)
424 } 429 }
425 } 430 }
426 INF("Run desktop cache creation: %s", eina_strbuf_string_get(file)); 431 INF("Run desktop cache creation: %s", eina_strbuf_string_get(file));
432 fprintf(efreetd_log_file, "[%09.3f] Run:\n %s\n", ecore_time_get(),
433 eina_strbuf_string_get(file));
434 fflush(efreetd_log_file);
427 desktop_cache_exe = ecore_exe_pipe_run 435 desktop_cache_exe = ecore_exe_pipe_run
428 (eina_strbuf_string_get(file), ECORE_EXE_PIPE_READ | 436 (eina_strbuf_string_get(file),
429 ECORE_EXE_PIPE_READ_LINE_BUFFERED, 437 ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_READ_LINE_BUFFERED,
430 NULL); 438 NULL);
431 439
432 eina_strbuf_free(file); 440 eina_strbuf_free(file);
433 441
@@ -802,6 +810,8 @@ cache_exe_data_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
802 { 810 {
803 Eina_Bool update = EINA_FALSE; 811 Eina_Bool update = EINA_FALSE;
804 812
813 fprintf(efreetd_log_file, "[%09.3f] Data desktop_cache_create\n", ecore_time_get());
814 fflush(efreetd_log_file);
805 if ((ev->lines) && (*ev->lines->line == 'c')) update = EINA_TRUE; 815 if ((ev->lines) && (*ev->lines->line == 'c')) update = EINA_TRUE;
806 if (!desktop_exists) 816 if (!desktop_exists)
807 send_signal_desktop_cache_build(); 817 send_signal_desktop_cache_build();
@@ -812,11 +822,15 @@ cache_exe_data_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
812 { 822 {
813 Eina_Bool update = EINA_FALSE; 823 Eina_Bool update = EINA_FALSE;
814 824
825 fprintf(efreetd_log_file, "[%09.3f] Data icon_cache_create\n", ecore_time_get());
826 fflush(efreetd_log_file);
815 if ((ev->lines) && (*ev->lines->line == 'c')) update = EINA_TRUE; 827 if ((ev->lines) && (*ev->lines->line == 'c')) update = EINA_TRUE;
816 send_signal_icon_cache_update(update); 828 send_signal_icon_cache_update(update);
817 } 829 }
818 else if (ev->exe == mime_cache_exe) 830 else if (ev->exe == mime_cache_exe)
819 { 831 {
832 fprintf(efreetd_log_file, "[%09.3f] Data mime_cache_create\n", ecore_time_get());
833 fflush(efreetd_log_file);
820 // XXX: ZZZ: handle stdout here from cache updater... if needed 834 // XXX: ZZZ: handle stdout here from cache updater... if needed
821 } 835 }
822 return ECORE_CALLBACK_RENEW; 836 return ECORE_CALLBACK_RENEW;
@@ -829,16 +843,22 @@ cache_exe_del_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
829 843
830 if (ev->exe == desktop_cache_exe) 844 if (ev->exe == desktop_cache_exe)
831 { 845 {
846 fprintf(efreetd_log_file, "[%09.3f] Exit desktop_cache_create\n", ecore_time_get());
847 fflush(efreetd_log_file);
832 desktop_cache_exe = NULL; 848 desktop_cache_exe = NULL;
833 if (desktop_queue) cache_desktop_update(); 849 if (desktop_queue) cache_desktop_update();
834 } 850 }
835 else if (ev->exe == icon_cache_exe) 851 else if (ev->exe == icon_cache_exe)
836 { 852 {
853 fprintf(efreetd_log_file, "[%09.3f] Exit icon_cache_create\n", ecore_time_get());
854 fflush(efreetd_log_file);
837 icon_cache_exe = NULL; 855 icon_cache_exe = NULL;
838 if (icon_queue) cache_icon_update(EINA_FALSE); 856 if (icon_queue) cache_icon_update(EINA_FALSE);
839 } 857 }
840 else if (ev->exe == mime_cache_exe) 858 else if (ev->exe == mime_cache_exe)
841 { 859 {
860 fprintf(efreetd_log_file, "[%09.3f] Exit mime_cache_create\n", ecore_time_get());
861 fflush(efreetd_log_file);
842 mime_cache_exe = NULL; 862 mime_cache_exe = NULL;
843 send_signal_mime_cache_build(); 863 send_signal_mime_cache_build();
844 } 864 }