logging.h File Reference

clockd logging interface More...

#include <syslog.h>

Defines

#define DO_LOG(__level,...)
#define DO_LOG_STR_SLIST(__level, __slist)

Functions

void dump_date (const char *server_tz)
void log_tm (const char *tag, const struct tm *tm)


Detailed Description

Interface to syslog and console debug printing

Copyright (C) 2008 Nokia. All rights reserved.

Author:
Raimo Vuonnala <raimo.vuonnala@nokia.com>

Define Documentation

#define DO_LOG ( __level,
...   ) 

Value:

{                                       \
  if (__level == LOG_DEBUG && !clockd_debug_mode) ;             \
  else {                                                        \
    if (clockd_debug_mode) {                                    \
      printf(MESTR __VA_ARGS__); printf("\n"); fflush(stdout);  \
    }                                                           \
    syslog(__level, __VA_ARGS__);                               \
  }                                                             \
}
Macro to do all logging

Parameters:
__level Message level, one of the following:
  • LOG_CRIT - critical failure
  • LOG_ERR - error condition, possibly resulting in reduced functionality
  • LOG_WARNING - abnormal condition, possibly resulting in reduced functionality
  • LOG_NOTICE - normal, but significant, condition
  • LOG_INFO - informational message
  • LOG_DEBUG - debugging message (NO-OP if not in debug mode)
... Typically printf-style formatter and parameters

Referenced by decode_ctm(), dump_date(), handle_alarm(), handle_csd_net_time_change(), internal_check_timezone(), internal_set_time(), internal_set_tz(), log_tm(), mainloop_run(), mainloop_stop(), mcc_tz_add_registration_change_match(), mcc_tz_check_if_network_timeinfo_available(), mcc_tz_correct_tz_choice(), mcc_tz_find_country_by_mcc(), mcc_tz_find_tz_in_country_tz_list(), mcc_tz_handle_registration_status_reply(), mcc_tz_network_timeinfo_reply_dbus_cb(), mcc_tz_registration_status_reply_dbus_cb(), mcc_tz_remove_registration_change_match(), mcc_tz_searching_tz_by_country_name(), mcc_tz_set_tz_from_mcc(), mcc_tz_setup_timezone_from_mcc_if_required(), read_conf(), save_conf(), server_filter(), server_init(), server_quit(), server_send_time_change_indication(), server_set_autosync_cb(), server_set_time_cb(), server_set_time_format_cb(), server_set_tz_cb(), set_time(), sighnd_handler(), and sighnd_terminate().

#define DO_LOG_STR_SLIST ( __level,
__slist   ) 

Value:

{ \
  if(__level == LOG_DEBUG && !clockd_debug_mode) ;    \
  else { \
    if(!__slist) \
    { \
      DO_LOG(__level, "GSList empty"); \
    } \
    else \
    { \
      GSList *iter = __slist; \
      DO_LOG(__level, "GSList count = %d", g_slist_length (__slist)); \
      while(iter) \
      { \
        DO_LOG(__level, "%s", (char*)iter->data); \
        iter = g_slist_next(iter); \
      } \
    } \
  } \
}
Macro to do logging of slist of strings

Parameters:
__level Message level, one of the following:
  • LOG_CRIT - critical failure
  • LOG_ERR - error condition, possibly resulting in reduced functionality
  • LOG_WARNING - abnormal condition, possibly resulting in reduced functionality
  • LOG_NOTICE - normal, but significant, condition
  • LOG_INFO - informational message
  • LOG_DEBUG - debugging message (NO-OP if not in debug mode)
__slist pointer to slist head

Referenced by mcc_tz_create_tz_name_list_by_country_name().


Function Documentation

void dump_date ( const char *  server_tz  ) 

Dump current date settings to syslog.

Parameters:
server_tz current server timezone to be printed in log

Referenced by handle_csd_net_time_change(), server_init(), server_set_time_cb(), and server_set_tz_cb().

void log_tm ( const char *  tag,
const struct tm *  tm 
)

Log tm structure

Parameters:
tag string describing tm
tm tm to be logged

Referenced by handle_csd_net_time_change(), and mcc_tz_find_tz_in_country_tz_list().


Generated on Mon Jun 21 15:45:53 2010 for clockd by  doxygen 1.5.6