[asterisk-commits] russell: branch group/security_events r194763 - /team/group/security_events/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri May 15 13:40:03 CDT 2009
Author: russell
Date: Fri May 15 13:39:59 2009
New Revision: 194763
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=194763
Log:
Use a dynamic logger level for LOG_SECURITY
Modified:
team/group/security_events/res/res_security_log.c
Modified: team/group/security_events/res/res_security_log.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/res/res_security_log.c?view=diff&rev=194763&r1=194762&r2=194763
==============================================================================
--- team/group/security_events/res/res_security_log.c (original)
+++ team/group/security_events/res/res_security_log.c Fri May 15 13:39:59 2009
@@ -34,6 +34,10 @@
#include "asterisk/threadstorage.h"
#include "asterisk/strings.h"
#include "asterisk/security_events.h"
+
+static const char LOG_SECURITY_NAME[] = "SECURITY";
+
+static int LOG_SECURITY;
static struct ast_event_sub *security_event_sub;
@@ -118,13 +122,19 @@
append_ies(&str, event,
ast_security_event_get_optional_ies(event_type), NOT_REQUIRED);
- ast_log(LOG_SECURITY, "%s\n", ast_str_buffer(str));
+ ast_log_dynamic_level(LOG_SECURITY, "%s\n", ast_str_buffer(str));
}
static int load_module(void)
{
+ if ((LOG_SECURITY = ast_logger_register_level(LOG_SECURITY_NAME)) == -1) {
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
if (!(security_event_sub = ast_event_subscribe(AST_EVENT_SECURITY,
security_event_cb, NULL, AST_EVENT_IE_END))) {
+ ast_logger_unregister_level(LOG_SECURITY_NAME);
+ LOG_SECURITY = -1;
return AST_MODULE_LOAD_DECLINE;
}
More information about the asterisk-commits
mailing list