summaryrefslogtreecommitdiff
path: root/ot_stats.c
diff options
context:
space:
mode:
authorerdgeist <>2010-04-21 13:23:40 +0000
committererdgeist <>2010-04-21 13:23:40 +0000
commit66cda4bc7559ef0930b8dd0d36ac64c274defbd6 (patch)
tree2bbe4b13f841265962b4cbade6b45c8a4729d9de /ot_stats.c
parent85e6880233c114450f6a0cc9e655e8c14c8af80a (diff)
Add our own time stamps to the completed logs.
Diffstat (limited to 'ot_stats.c')
-rw-r--r--ot_stats.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ot_stats.c b/ot_stats.c
index 1f5e5e9..8ba6ade 100644
--- a/ot_stats.c
+++ b/ot_stats.c
@@ -642,9 +642,17 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event
642 case EVENT_COMPLETED: 642 case EVENT_COMPLETED:
643#ifdef WANT_SYSLOGS 643#ifdef WANT_SYSLOGS
644 if( event_data) { 644 if( event_data) {
645 char timestring[64];
645 char hex_out[42]; 646 char hex_out[42];
647 struct tm time_now;
648 time_t ttt;
649
650 time( &ttt );
651 localtime_r( &ttt, &time_now );
652 strftime( timestring, sizeof( timestring ), "%FT%T%z", &time_now );
653
646 to_hex( hex_out, (uint8_t*)event_data ); 654 to_hex( hex_out, (uint8_t*)event_data );
647 syslog( LOG_INFO, "event=completed info_hash=%s", hex_out ); 655 syslog( LOG_INFO, "time=%s event=completed info_hash=%s", timestring, hex_out );
648 } 656 }
649#endif 657#endif
650 ot_overall_completed++; 658 ot_overall_completed++;