Browse code

core: several error messages printed to corelog level

- instead of static level L_ERR use now the global config option corelog
- corelog value can be updated at runtime without restart via RPC
commands

Daniel-Constantin Mierla authored on 07/03/2011 12:55:10
Showing 3 changed files
... ...
@@ -710,7 +710,7 @@ int parse_msg(char* buf, unsigned int len, struct sip_msg* msg)
710 710
 
711 711
 error:
712 712
 	/* more debugging, msg->orig is/should be null terminated*/
713
-	LOG(L_ERR, "ERROR: parse_msg: message=<%.*s>\n",
713
+	LOG(cfg_get(core, core_cfg, corelog), "ERROR: parse_msg: message=<%.*s>\n",
714 714
 			(int)msg->len, ZSW(msg->buf));
715 715
 	return -1;
716 716
 }
... ...
@@ -139,7 +139,8 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
139 139
 	msg->set_global_port=default_global_port;
140 140
 	
141 141
 	if (parse_msg(buf,len, msg)!=0){
142
-		LOG(L_ERR, "ERROR: receive_msg: parse_msg failed\n");
142
+		LOG(cfg_get(core, core_cfg, corelog),
143
+				"ERROR: receive_msg: parse_msg failed\n");
143 144
 		goto error02;
144 145
 	}
145 146
 	DBG("After parse_msg...\n");
... ...
@@ -266,7 +266,8 @@ again:
266 266
 								break;
267 267
 						}
268 268
 				}
269
-				LOG(L_ERR, "error reading: %s (%d)\n", strerror(errno), errno);
269
+				LOG(cfg_get(core, core_cfg, corelog),
270
+						"error reading: %s (%d)\n", strerror(errno), errno);
270 271
 				return -1;
271 272
 			}
272 273
 		}else if (unlikely((bytes_read==0) || 
... ...
@@ -879,7 +880,8 @@ again:
879 879
 					req->start);
880 880
 #endif
881 881
 			if (unlikely(bytes==-1)){
882
-				LOG(L_ERR, "ERROR: tcp_read_req: error reading \n");
882
+				LOG(cfg_get(core, core_cfg, corelog),
883
+						"ERROR: tcp_read_req: error reading \n");
883 884
 				resp=CONN_ERROR;
884 885
 				goto end_req;
885 886
 			}