aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r--src/util/common_logging.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 59a2eeb29..93a104c8d 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -294,7 +294,7 @@ GNUNET_abort ()
294 * Rotate logs, deleting the oldest log. 294 * Rotate logs, deleting the oldest log.
295 * 295 *
296 * @param new_name new name to add to the rotation 296 * @param new_name new name to add to the rotation
297 */ 297 */
298static void 298static void
299log_rotate (const char *new_name) 299log_rotate (const char *new_name)
300{ 300{
@@ -313,7 +313,7 @@ log_rotate (const char *new_name)
313 GNUNET_free (discard); 313 GNUNET_free (discard);
314 } 314 }
315 rotation[rotation_off % ROTATION_KEEP] = GNUNET_strdup (new_name); 315 rotation[rotation_off % ROTATION_KEEP] = GNUNET_strdup (new_name);
316 rotation_off++; 316 rotation_off++;
317} 317}
318 318
319 319
@@ -326,14 +326,14 @@ log_rotate (const char *new_name)
326static int 326static int
327setup_log_file (const struct tm *tm) 327setup_log_file (const struct tm *tm)
328{ 328{
329 static char last_fn[PATH_MAX + 1]; 329 static char last_fn[PATH_MAX + 1];
330 char fn[PATH_MAX + 1]; 330 char fn[PATH_MAX + 1];
331 int dirwarn; 331 int dirwarn;
332 int altlog_fd; 332 int altlog_fd;
333 int dup_return; 333 int dup_return;
334 FILE *altlog; 334 FILE *altlog;
335 char *leftsquare; 335 char *leftsquare;
336 336
337 if (NULL == log_file_name) 337 if (NULL == log_file_name)
338 return GNUNET_SYSERR; 338 return GNUNET_SYSERR;
339 if (0 == strftime (fn, sizeof (fn), log_file_name, tm)) 339 if (0 == strftime (fn, sizeof (fn), log_file_name, tm))
@@ -392,7 +392,7 @@ setup_log_file (const struct tm *tm)
392 fn); 392 fn);
393 return GNUNET_SYSERR; 393 return GNUNET_SYSERR;
394 } 394 }
395 GNUNET_stderr = altlog; 395 GNUNET_stderr = altlog;
396 return GNUNET_OK; 396 return GNUNET_OK;
397} 397}
398 398
@@ -665,7 +665,7 @@ parse_all_definitions ()
665 */ 665 */
666int 666int
667GNUNET_log_setup (const char *comp, 667GNUNET_log_setup (const char *comp,
668 const char *loglevel, 668 const char *loglevel,
669 const char *logfile) 669 const char *logfile)
670{ 670{
671 const char *env_logfile; 671 const char *env_logfile;
@@ -831,7 +831,7 @@ flush_bulk (const char *datestr)
831 * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero 831 * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero
832 */ 832 */
833void 833void
834GNUNET_log_skip (int n, 834GNUNET_log_skip (int n,
835 int check_reset) 835 int check_reset)
836{ 836{
837 int ok; 837 int ok;
@@ -872,7 +872,7 @@ GNUNET_get_log_skip ()
872 */ 872 */
873static void 873static void
874mylog (enum GNUNET_ErrorType kind, 874mylog (enum GNUNET_ErrorType kind,
875 const char *comp, 875 const char *comp,
876 const char *message, 876 const char *message,
877 va_list va) 877 va_list va)
878{ 878{
@@ -949,7 +949,7 @@ mylog (enum GNUNET_ErrorType kind,
949 strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%06u", tmptr); 949 strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%06u", tmptr);
950 snprintf (date, sizeof (date), date2, timeofday.tv_usec); 950 snprintf (date, sizeof (date), date2, timeofday.tv_usec);
951 } 951 }
952#endif 952#endif
953 VSNPRINTF (buf, size, message, va); 953 VSNPRINTF (buf, size, message, va);
954 if (NULL != tmptr) 954 if (NULL != tmptr)
955 (void) setup_log_file (tmptr); 955 (void) setup_log_file (tmptr);
@@ -959,7 +959,7 @@ mylog (enum GNUNET_ErrorType kind,
959 { 959 {
960 last_bulk_repeat++; 960 last_bulk_repeat++;
961 if ( (GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value_us > 961 if ( (GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value_us >
962 BULK_DELAY_THRESHOLD) || 962 BULK_DELAY_THRESHOLD) ||
963 (last_bulk_repeat > BULK_REPEAT_THRESHOLD) ) 963 (last_bulk_repeat > BULK_REPEAT_THRESHOLD) )
964 flush_bulk (date); 964 flush_bulk (date);
965 return; 965 return;
@@ -983,7 +983,7 @@ mylog (enum GNUNET_ErrorType kind,
983 * @param ... arguments for format string 983 * @param ... arguments for format string
984 */ 984 */
985void 985void
986GNUNET_log_nocheck (enum GNUNET_ErrorType kind, 986GNUNET_log_nocheck (enum GNUNET_ErrorType kind,
987 const char *message, ...) 987 const char *message, ...)
988{ 988{
989 va_list va; 989 va_list va;
@@ -1199,7 +1199,7 @@ GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen)
1199 * @param option name of missing option 1199 * @param option name of missing option
1200 */ 1200 */
1201void 1201void
1202GNUNET_log_config_missing (enum GNUNET_ErrorType kind, 1202GNUNET_log_config_missing (enum GNUNET_ErrorType kind,
1203 const char *section, 1203 const char *section,
1204 const char *option) 1204 const char *option)
1205{ 1205{
@@ -1219,7 +1219,7 @@ GNUNET_log_config_missing (enum GNUNET_ErrorType kind,
1219 * @param required what is required that is invalid about the option 1219 * @param required what is required that is invalid about the option
1220 */ 1220 */
1221void 1221void
1222GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, 1222GNUNET_log_config_invalid (enum GNUNET_ErrorType kind,
1223 const char *section, 1223 const char *section,
1224 const char *option, 1224 const char *option,
1225 const char *required) 1225 const char *required)
@@ -1240,7 +1240,7 @@ void __attribute__ ((constructor)) GNUNET_util_cl_init ()
1240 GNInitWinEnv (NULL); 1240 GNInitWinEnv (NULL);
1241#endif 1241#endif
1242#if WINDOWS 1242#if WINDOWS
1243 if (!InitializeCriticalSectionAndSpinCount (&output_message_cs, 0x00000400)) 1243 if (!InitializeCriticalSectionAndSpinCount (&output_message_cs, 0x00000400))
1244 GNUNET_abort (); 1244 GNUNET_abort ();
1245#endif 1245#endif
1246} 1246}