diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/rofi.c | 5 | ||||
-rw-r--r-- | source/timings.c | 22 |
2 files changed, 7 insertions, 20 deletions
diff --git a/source/rofi.c b/source/rofi.c index a05a9a73..650e788d 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -312,11 +312,6 @@ static void help ( G_GNUC_UNUSED int argc, char **argv ) #else printf ( "\t* drun %sdisabled%s\n", is_term ? color_red : "", is_term ? color_reset : "" ); #endif -#ifdef TIMINGS - printf ( "\t* timings %senabled%s\n", is_term ? color_green : "", is_term ? color_reset : "" ); -#else - printf ( "\t* timings %sdisabled%s\n", is_term ? color_red : "", is_term ? color_reset : "" ); -#endif #ifdef ENABLE_GCOV printf ( "\t* gcov %senabled%s\n", is_term ? color_green : "", is_term ? color_reset : "" ); #else diff --git a/source/timings.c b/source/timings.c index 4ad1c44e..4e4ba508 100644 --- a/source/timings.c +++ b/source/timings.c @@ -25,42 +25,34 @@ * */ +#define G_LOG_DOMAIN "Timings" + #include "config.h" #include <stdio.h> #include "rofi.h" #include "timings.h" -#ifdef TIMINGS GTimer *global_timer = NULL; double global_timer_last = 0.0; -FILE *timing_log = NULL; void rofi_timings_init ( void ) { - timing_log = fopen ( "rofi-timing.log", "w" ); - if ( timing_log != NULL ) { - global_timer = g_timer_new (); - double now = g_timer_elapsed ( global_timer, NULL ); - fprintf ( timing_log, "%4.6f (%2.6f): Started\n", now, 0.0 ); - } + global_timer = g_timer_new (); + double now = g_timer_elapsed ( global_timer, NULL ); + g_debug ( "%4.6f (%2.6f): Started", now, 0.0 ); } void rofi_timings_tick ( const char *file, char const *str, int line, char const *msg ) { double now = g_timer_elapsed ( global_timer, NULL ); - fprintf ( timing_log, "%4.6f (%2.6f): %s:%s:%-3d %s\n", now, now - global_timer_last, file, str, line, msg ); + g_debug ( "%4.6f (%2.6f): %s:%s:%-3d %s", now, now - global_timer_last, file, str, line, msg ); global_timer_last = now; } void rofi_timings_quit ( void ) { - if ( timing_log ) { double now = g_timer_elapsed ( global_timer, NULL ); - fprintf ( timing_log, "%4.6f (%2.6f): Stopped\n", now, 0.0 ); + g_debug ( "%4.6f (%2.6f): Stopped", now, 0.0 ); g_timer_destroy ( global_timer ); - fclose ( timing_log ); - timing_log = NULL; - } } -#endif |