Browse code

- cleanup in modules, instead of logging module initialization in each mod_init (with different messages, levels..) do this in the core

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4657 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 10/08/2008 22:51:44
Showing 51 changed files
... ...
@@ -331,8 +331,6 @@ static int free_acc_fixup(void** param, int param_no)
331 331
 
332 332
 static int mod_init( void )
333 333
 {
334
-	LM_INFO("initializing...\n");
335
-
336 334
 #ifdef SQL_ACC
337 335
 	if (db_url.s)
338 336
 		db_url.len = strlen(db_url.s);
... ...
@@ -127,7 +127,6 @@ static int child_init(int rank)
127 127
  */
128 128
 static int mod_init(void)
129 129
 {
130
-	LM_INFO("initializing...\n");
131 130
 	db_url.len = strlen(db_url.s);
132 131
 	user_column.len = strlen(user_column.s);
133 132
 	domain_column.len = strlen(domain_column.s);
... ...
@@ -215,7 +215,6 @@ static inline int generate_random_secret(void)
215 215
 static int mod_init(void)
216 216
 {
217 217
 	str stmp;
218
-	LM_INFO("initializing...\n");
219 218
 	
220 219
 	/* load the SL API */
221 220
 	if (load_sl_api(&slb)!=0) {
... ...
@@ -170,8 +170,6 @@ static int mod_init(void)
170 170
 {
171 171
 	bind_auth_t bind_auth;
172 172
 
173
-	LM_INFO("initializing...\n");
174
-
175 173
 	db_url.len = strlen(db_url.s);
176 174
 	user_column.len = strlen(user_column.s);
177 175
 	domain_column.len = strlen(domain_column.s);
... ...
@@ -117,8 +117,6 @@ static int mod_init(void)
117 117
 	DICT_VENDOR *vend;
118 118
 	bind_auth_t bind_auth;
119 119
 
120
-	LM_INFO("initializing...\n");
121
-
122 120
 	memset(attrs, 0, sizeof(attrs));
123 121
 	memset(vals, 0, sizeof(vals));
124 122
 	attrs[A_SERVICE_TYPE].n			= "Service-Type";
... ...
@@ -111,8 +111,6 @@ struct module_exports exports = {
111 111
 
112 112
 static int mod_init(void)
113 113
 {
114
-	LM_INFO("initializing...\n");
115
-
116 114
 	memset(attrs, 0, sizeof(attrs));
117 115
 	memset(vals, 0, sizeof(vals));
118 116
 
... ...
@@ -163,8 +163,6 @@ struct module_exports exports = {
163 163
 
164 164
 static int avpops_init(void)
165 165
 {
166
-	LM_INFO("initializing...\n");
167
-
168 166
 	if (db_url.s)
169 167
 		db_url.len = strlen(db_url.s);
170 168
 	if (db_table.s)
... ...
@@ -189,8 +189,6 @@ static int mod_init(void) {
189 189
 
190 190
 	int ret = 0;
191 191
 
192
-	LM_INFO("benchmark: initializing\n");
193
-
194 192
 	bm_mycfg = (bm_cfg_t*)shm_malloc(sizeof(bm_cfg_t));
195 193
 	memset(bm_mycfg, 0, sizeof(bm_cfg_t));
196 194
 	bm_mycfg->enable_global = bm_enable_global;
... ...
@@ -237,8 +237,6 @@ static int cpl_init(void)
237 237
 	db_table.len = strlen(db_table.s);
238 238
 	if (timer_avp.s) timer_avp.len = strlen(timer_avp.s);
239 239
 
240
-	LM_INFO("initializing...\n");
241
-
242 240
 	if (cpl_env.proxy_recurse>MAX_PROXY_RECURSE) {
243 241
 		LM_CRIT("value of proxy_recurse param (%d) exceeds "
244 242
 			"the maximum safety value (%d)\n",
... ...
@@ -69,7 +69,6 @@ struct module_exports exports = {
69 69
 
70 70
 static int mod_init(void)
71 71
 {
72
-	LM_INFO("initializing...\n");
73 72
 	return 0;
74 73
 }
75 74
 
... ...
@@ -320,8 +320,6 @@ static int mod_init(void)
320 320
 {
321 321
 	unsigned int n;
322 322
 
323
-	LM_INFO("Dialog module - initializing\n");
324
-
325 323
 	if (timeout_spec.s)
326 324
 		timeout_spec.len = strlen(timeout_spec.s);
327 325
 
... ...
@@ -115,8 +115,6 @@ struct module_exports exports= {
115 115
 
116 116
 static int mod_init(void)
117 117
 {
118
-	LM_INFO("initializing module...\n");
119
-	
120 118
 	dp_db_url.len = dp_db_url.s ? strlen(dp_db_url.s) : 0;
121 119
 	LM_DBG("db_url=%s/%d/%p\n", ZSW(dp_db_url.s), dp_db_url.len,dp_db_url.s);
122 120
 	dp_table_name.len   = strlen(dp_table_name.s);
... ...
@@ -212,8 +212,6 @@ static int mod_init(void)
212 212
 	if (ds_ping_from.s) ds_ping_from.len = strlen(ds_ping_from.s);
213 213
 	if (ds_ping_method.s) ds_ping_method.len = strlen(ds_ping_method.s);
214 214
 
215
-	LM_DBG("initializing ...\n");
216
-
217 215
 	if(init_data()!= 0)
218 216
 		return -1;
219 217
 
... ...
@@ -96,7 +96,6 @@ struct module_exports exports = {
96 96
 
97 97
 static int mod_init(void)
98 98
 {
99
-	LM_INFO("initializing...\n");
100 99
 	suffix.len = strlen(suffix.s);
101 100
 	return 0;
102 101
 }
... ...
@@ -154,8 +154,6 @@ static int mod_init(void)
154 154
 	unsigned int par;
155 155
 	int ver;
156 156
 
157
-	LM_INFO("initializing...\n");
158
-	
159 157
 	db_url.len = strlen(db_url.s);
160 158
 	domainpolicy_table.len = strlen(domainpolicy_table.s);
161 159
 	domainpolicy_col_rule.len = strlen(domainpolicy_col_rule.s);
... ...
@@ -108,7 +108,6 @@ void exec_shutdown(void)
108 108
 
109 109
 static int mod_init( void )
110 110
 {
111
-	LM_INFO("exec - initializing\n");
112 111
 	if (time_to_kill) initialize_kill();
113 112
 	return 0;
114 113
 }
... ...
@@ -176,8 +176,6 @@ static int child_init(int rank)
176 176
 
177 177
 static int mod_init(void)
178 178
 {
179
-	LM_DBG("group module - initializing\n");
180
-
181 179
 	/* Calculate lengths */
182 180
 	db_url.len = strlen(db_url.s);
183 181
 	table.len = strlen(table.s);
... ...
@@ -148,8 +148,6 @@ static int child_init(int rank)
148 148
 
149 149
 static int mod_init(void)
150 150
 {
151
-	LM_INFO("H350 module - initializing\n");
152
-
153 151
 	/*
154 152
 	 * load the LDAP API
155 153
 	 */
... ...
@@ -336,9 +336,6 @@ error:
336 336
 
337 337
 static int mod_init(void)
338 338
 {
339
-
340
-	LM_INFO("initializing ...\n");
341
-
342 339
 	if(imc_hash_size <= 0)
343 340
 	{
344 341
 		LM_ERR("invalid hash size\n");
... ...
@@ -203,7 +203,6 @@ static int mod_init(void)
203 203
 	int  i;
204 204
 	db_url.len = strlen(db_url.s);
205 205
 
206
-	LM_INFO("initializing ...\n");
207 206
 	if(!jdomain)
208 207
 	{
209 208
 		LM_ERR("jdomain is NULL\n");
... ...
@@ -197,8 +197,6 @@ static int mod_init(void)
197 197
 	char* section_name;
198 198
 	char* ldap_version;
199 199
 	
200
-	LM_INFO("LDAP_H350 module - initializing\n");
201
-
202 200
 	/*
203 201
 	* read config file
204 202
 	*/
... ...
@@ -95,7 +95,6 @@ struct module_exports exports= {
95 95
 
96 96
 static int mod_init(void)
97 97
 {
98
-	LM_INFO("initializing...\n");
99 98
 	if ( max_limit<1 || max_limit>MAXFWD_UPPER_LIMIT ) {
100 99
 		LM_ERR("invalid max limit (%d) [1,%d]\n",
101 100
 			max_limit,MAXFWD_UPPER_LIMIT);
... ...
@@ -271,8 +271,6 @@ static int mod_init(void)
271 271
 	if (ms_snd_time_avp_param.s)
272 272
 		ms_snd_time_avp_param.len = strlen(ms_snd_time_avp_param.s);
273 273
 
274
-	LM_DBG("initializing ...\n");
275
-
276 274
 	/* binding to mysql module  */
277 275
 	if (db_bind_mod(&ms_db_url, &msilo_dbf))
278 276
 	{
... ...
@@ -104,8 +104,6 @@ struct module_exports exports = {
104 104
  */
105 105
 static int mod_init(void) {
106 106
 
107
-	LM_INFO("initializing...\n");
108
-
109 107
 	/* load the SL API */
110 108
 	if (load_sl_api(&slb)!=0) {
111 109
 		LM_ERR("can't load SL API\n");
... ...
@@ -169,8 +169,6 @@ static int ospInitMod(void)
169 169
 {
170 170
     bind_auth_t bind_auth;
171 171
 
172
-    LM_INFO("initializing...\n");
173
-
174 172
     if (ospVerifyParameters() != 0) {
175 173
         /* At least one parameter incorrect -> error */
176 174
         return -1;   
... ...
@@ -160,8 +160,6 @@ struct module_exports exports = {
160 160
  */
161 161
 static int mod_init(void)
162 162
 {
163
-	LM_INFO("initializing...\n");
164
-
165 163
 	db_url.len = strlen(db_url.s);
166 164
 	db_table.len = strlen(db_table.s);
167 165
 	sdomain_column.len = strlen(sdomain_column.s);
... ...
@@ -108,8 +108,6 @@ struct module_exports exports = {
108 108
  */
109 109
 static int mod_init(void)
110 110
 {
111
-    LM_DBG("initializing\n");
112
-
113 111
     memset(attrs, 0, sizeof(attrs));
114 112
     memset(vals, 0, sizeof(vals));
115 113
     attrs[A_USER_NAME].n = "User-Name";
... ...
@@ -303,8 +303,6 @@ static int mod_init(void) {
303 303
 
304 304
 	int ret = 0;
305 305
 
306
-	LM_INFO("initializing...\n");
307
-
308 306
 	if (!filename) {
309 307
 		LM_ERR("insufficient module parameters. Module not loaded.\n");
310 308
 		return -1;
... ...
@@ -574,8 +574,6 @@ static int double_fixup(void** param, int param_no)
574 574
  */
575 575
 static int mod_init(void)
576 576
 {
577
-	LM_DBG("initializing...\n");
578
-
579 577
 	if (db_url.s)
580 578
 		db_url.len = strlen(db_url.s);
581 579
 	trusted_table.len = strlen(trusted_table.s);
... ...
@@ -110,8 +110,6 @@ struct module_exports exports= {
110 110
 
111 111
 static int pike_init(void)
112 112
 {
113
-	LM_INFO("initializing...\n");
114
-
115 113
 	/* alloc the timer lock */
116 114
 	timer_lock=lock_alloc();
117 115
 	if (timer_lock==0) {
... ...
@@ -187,8 +187,6 @@ static int mod_init(void)
187 187
 	active_watchers_table.len = strlen(active_watchers_table.s);
188 188
 	watchers_table.len = strlen(watchers_table.s);
189 189
 
190
-	LM_NOTICE("initializing module ...\n");
191
-
192 190
 	if(db_url.s== NULL)
193 191
 	{
194 192
 		use_db= 0;
... ...
@@ -83,8 +83,6 @@ struct module_exports exports= {
83 83
 static int mod_init(void)
84 84
 {
85 85
 	presence_api_t pres;
86
-    LM_INFO("initializing...\n");
87
-
88 86
     bind_presence_t bind_presence;
89 87
 
90 88
     bind_presence= (bind_presence_t)find_export("bind_presence", 1,0);
... ...
@@ -100,8 +100,6 @@ static int mod_init(void)
100 100
 {
101 101
 	bind_usrloc_t bind_usrloc;
102 102
 	bind_pua_t bind_pua;
103
-
104
-	LM_DBG("initializing module ...\n");
105 103
 	
106 104
 	if(default_domain.s == NULL )
107 105
 	{	
... ...
@@ -419,8 +419,6 @@ static int mod_init(void)
419 419
 {
420 420
 	int i;
421 421
 
422
-	LM_DBG("initializing ...\n");
423
-
424 422
 	rl_lock = lock_alloc();
425 423
 	if (! rl_lock) {
426 424
 		LM_ERR("oom in lock_alloc()\n");
... ...
@@ -222,8 +222,6 @@ static int mod_init(void)
222 222
 	str s;
223 223
 	bind_usrloc_t bind_usrloc;
224 224
 
225
-	LM_INFO("initializing...\n");
226
-
227 225
 	/* load the SL API */
228 226
 	if (load_sl_api(&slb)!=0) {
229 227
 		LM_ERR("can't load SL API\n");
... ...
@@ -73,8 +73,7 @@ static unsigned int last_rr_msg;
73 73
 
74 74
 MODULE_VERSION
75 75
 
76
-static int  mod_init(void);
77
-static void mod_destroy(void);
76
+static int  mod_init(void);static void mod_destroy(void);
78 77
 /* fixup functions */
79 78
 static int direction_fixup(void** param, int param_no);
80 79
 static int it_list_fixup(void** param, int param_no);
... ...
@@ -141,7 +140,6 @@ struct module_exports exports = {
141 140
 
142 141
 static int mod_init(void)
143 142
 {
144
-	LM_DBG("rr - initializing\n");
145 143
 #ifdef ENABLE_USER_CHECK
146 144
 	if(ignore_user)
147 145
 	{
... ...
@@ -206,8 +206,6 @@ static int mod_init(void)
206 206
 	if (trace_local_ip.s)
207 207
 		trace_local_ip.len = strlen(trace_local_ip.s);
208 208
 
209
-	LM_INFO("initializing...\n");
210
-	
211 209
 	if (flag_idx2mask(&trace_flag)<0)
212 210
 		return -1;
213 211
 
... ...
@@ -603,8 +603,6 @@ void sms_process(int rank)
603 603
 
604 604
 static int sms_init(void)
605 605
 {
606
-	LM_INFO("SMS - initializing\n");
607
-
608 606
 	if (parse_config_lines()==-1)
609 607
 		return -1;
610 608
 	if (global_init()==-1)
... ...
@@ -129,8 +129,6 @@ static int child_init(int rank)
129 129
  */
130 130
 static int mod_init(void)
131 131
 {
132
-	LM_DBG("initializing\n");
133
-
134 132
 	db_url.len = strlen(db_url.s);
135 133
 	user_column.len = strlen(user_column.s);
136 134
 	domain_column.len = strlen(domain_column.s);
... ...
@@ -154,7 +154,6 @@ struct module_exports exports= {
154 154
 static int mod_init(void) 
155 155
 {
156 156
 	str s;
157
-	LM_INFO("SIP Session Timer module - initializing\n");
158 157
 	/*
159 158
 	 * if statistics are disabled, prevent their registration to core.
160 159
 	 */
... ...
@@ -94,8 +94,6 @@ static int reg_param_stat( modparam_t type, void* val)
94 94
 
95 95
 static int mod_init(void)
96 96
 {
97
-	LM_INFO("initializing\n");
98
-
99 97
 	if (register_all_mod_stats()!=0) {
100 98
 		LM_ERR("failed to register statistic variables\n");
101 99
 		return E_UNSPEC;
... ...
@@ -227,7 +227,6 @@ struct module_exports exports= {
227 227
 
228 228
 static int mod_init(void)
229 229
 {
230
-	LM_INFO("initializing...\n");
231 230
 	return 0;
232 231
 }
233 232
 
... ...
@@ -258,8 +258,6 @@ struct module_exports exports = {
258 258
 
259 259
 static int mod_init(void)
260 260
 {
261
-	LM_DBG("%s module - initializing...\n", exports.name);
262
-	
263 261
 	return 0;
264 262
 }
265 263
 
... ...
@@ -551,8 +551,6 @@ static int script_init( struct sip_msg *foo, void *bar)
551 551
 
552 552
 static int mod_init(void)
553 553
 {
554
-	LM_INFO("TM - initializing...\n");
555
-
556 554
 	/* checking if we have sufficient bitmap capacity for given
557 555
 	   maximum number of  branches */
558 556
 	if (MAX_BRANCHES+1>31) {
... ...
@@ -137,8 +137,6 @@ inline static int parse_auth_avp( char *avp_spec, pv_spec_t *avp, char *txt)
137 137
 
138 138
 static int mod_init(void)
139 139
 {
140
-	LM_INFO("initializing...\n");
141
-
142 140
 	if (from_restore_mode_str && *from_restore_mode_str) {
143 141
 		if (strcasecmp(from_restore_mode_str,"none")==0) {
144 142
 			from_restore_mode = FROM_NO_RESTORE;
... ...
@@ -154,10 +154,8 @@ static int child_init(int rank)
154 154
 static int mod_init(void)
155 155
 {
156 156
 	int ver;
157
-
158
-	LM_DBG("uri_db - initializing\n");
159
-
160 157
 	db_url.len = strlen(db_url.s);
158
+
161 159
 	if (db_url.len == 0) {
162 160
 		if (use_uri_table) {
163 161
 			LM_ERR("configuration error - no database URL, "
... ...
@@ -103,8 +103,6 @@ struct module_exports exports = {
103 103
 
104 104
 static int mod_init(void)
105 105
 {
106
-	LM_DBG("initializing\n");
107
-
108 106
 	memset(attrs, 0, sizeof(attrs));
109 107
 	memset(vals, 0, sizeof(vals));
110 108
 	attrs[A_SERVICE_TYPE].n	= "Service-Type";
... ...
@@ -520,15 +520,12 @@ struct mi_root * mi_reload_blacklist(struct mi_root* cmd, void* param)
520 520
 
521 521
 static int mod_init(void)
522 522
 {
523
-	LM_INFO("initializing ...\n");
524 523
 	db_url.len = strlen(db_url.s);
525 524
 	db_table.len = strlen(db_table.s);
526 525
 
527 526
 	if (db_bind(&db_url) != 0) return -1;
528 527
 	if (init_shmlock() != 0) return -1;
529 528
 	if (init_source_list() != 0) return -1;
530
-	LM_INFO("finished initializing\n");
531
-
532 529
 	return 0;
533 530
 }
534 531
 
... ...
@@ -209,8 +209,6 @@ struct module_exports exports = {
209 209
  */
210 210
 static int mod_init(void)
211 211
 {
212
-	LM_DBG("initializing\n");
213
-
214 212
 	/* Compute the lengths of string parameters */
215 213
 	user_col.len = strlen(user_col.s);
216 214
 	domain_col.len = strlen(domain_col.s);
... ...
@@ -123,7 +123,6 @@ struct module_exports exports= {
123 123
  */
124 124
 static int mod_init(void)
125 125
 {
126
-	LM_INFO("initializing...\n");
127 126
 	log_buf = (char*)pkg_malloc((buf_size+1)*sizeof(char));
128 127
 	if(log_buf==NULL)
129 128
 	{
... ...
@@ -197,8 +197,6 @@ struct module_exports exports = {
197 197
  */
198 198
 static int mod_init(void) {
199 199
 
200
-	LM_DBG("initializing\n");
201
-
202 200
 	if (load_tm_api(&tmb)) {
203 201
 		LM_ERR("failed to load tm API\n");
204 202
 		return -1;