Mercurial > pidgin-twitter
diff pidgin-twitter.h @ 168:56e3873e58a8
made log output configurable.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 30 Jul 2008 15:25:10 +0900 |
parents | 10516b7b05a9 |
children | 45da59a32019 7fb35f47a477 |
line wrap: on
line diff
--- a/pidgin-twitter.h Tue Jul 29 19:20:20 2008 +0900 +++ b/pidgin-twitter.h Wed Jul 30 15:25:10 2008 +0900 @@ -116,6 +116,7 @@ #define OPT_ICON_MAX_COUNT OPT_PIDGINTWITTER "/icon_max_count" #define OPT_ICON_MAX_DAYS OPT_PIDGINTWITTER "/icon_max_days" #define OPT_API_BASE_GET_INTERVAL OPT_PIDGINTWITTER "/api_base_get_interval" +#define OPT_LOG_OUTPUT OPT_PIDGINTWITTER "/log_output" /* formats and templates */ #define RECIPIENT_FORMAT_TWITTER "@<a href='http://twitter.com/%s'>%s</a>" @@ -167,8 +168,8 @@ #define DAYS_TO_SECONDS(d) ((d) * 86400) /* debug macros */ -#define twitter_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); -#define twitter_error(fmt, ...) purple_debug(PURPLE_DEBUG_ERROR, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); +#define twitter_debug(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); +#define twitter_error(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_ERROR, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); /* prototypes */ static void escape(gchar **str);