Sfoglia il codice sorgente

presence: new parameter local_log_level

- control verbosity of some log messages
- default value: L_INFO
Daniel-Constantin Mierla 11 anni fa
parent
commit
2ae18b74b7
2 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 4 1
      modules/presence/notify.c
  2. 2 0
      modules/presence/presence.c

+ 4 - 1
modules/presence/notify.c

@@ -55,6 +55,8 @@
 #define ALLOC_SIZE 3000
 #define MAX_FORWARD 70
 
+extern int pres_local_log_level;
+
 c_back_param* shm_dup_cbparam(subs_t*);
 void free_cbparam(c_back_param* cb_param);
 
@@ -1594,7 +1596,8 @@ jump_over_body:
 		goto error;
 	}
 
-	LM_DBG("NOTIFY %.*s via %.*s on behalf of %.*s for event %.*s\n",
+	LM_GEN1(pres_local_log_level,
+		"NOTIFY %.*s via %.*s on behalf of %.*s for event %.*s\n",
 		td->rem_uri.len, td->rem_uri.s, td->hooks.next_hop->len,
 		td->hooks.next_hop->s,
 		td->loc_uri.len, td->loc_uri.s, subs->event->name.len,

+ 2 - 0
modules/presence/presence.c

@@ -85,6 +85,7 @@ MODULE_VERSION
 char *log_buf = NULL;
 static int clean_period=100;
 static int db_update_period=100;
+int pres_local_log_level = L_INFO;
 
 /* database connection */
 db1_con_t *pa_db = NULL;
@@ -203,6 +204,7 @@ static param_export_t params[]={
 	{ "send_fast_notify",       INT_PARAM, &send_fast_notify},
 	{ "fetch_rows",             INT_PARAM, &pres_fetch_rows},
 	{ "db_table_lock_type",     INT_PARAM, &db_table_lock_type},
+	{ "local_log_level",        PARAM_INT, &pres_local_log_level},
     {0,0,0}
 };