Просмотр исходного кода

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 14 лет назад
Родитель
Сommit
b198224d60
3 измененных файлов с 7 добавлено и 4 удалено
  1. 1 1
      parser/msg_parser.c
  2. 2 1
      receive.c
  3. 4 2
      tcp_read.c

+ 1 - 1
parser/msg_parser.c

@@ -710,7 +710,7 @@ int parse_msg(char* buf, unsigned int len, struct sip_msg* msg)
 
 error:
 	/* more debugging, msg->orig is/should be null terminated*/
-	LOG(L_ERR, "ERROR: parse_msg: message=<%.*s>\n",
+	LOG(cfg_get(core, core_cfg, corelog), "ERROR: parse_msg: message=<%.*s>\n",
 			(int)msg->len, ZSW(msg->buf));
 	return -1;
 }

+ 2 - 1
receive.c

@@ -139,7 +139,8 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
 	msg->set_global_port=default_global_port;
 	
 	if (parse_msg(buf,len, msg)!=0){
-		LOG(L_ERR, "ERROR: receive_msg: parse_msg failed\n");
+		LOG(cfg_get(core, core_cfg, corelog),
+				"ERROR: receive_msg: parse_msg failed\n");
 		goto error02;
 	}
 	DBG("After parse_msg...\n");

+ 4 - 2
tcp_read.c

@@ -266,7 +266,8 @@ again:
 								break;
 						}
 				}
-				LOG(L_ERR, "error reading: %s (%d)\n", strerror(errno), errno);
+				LOG(cfg_get(core, core_cfg, corelog),
+						"error reading: %s (%d)\n", strerror(errno), errno);
 				return -1;
 			}
 		}else if (unlikely((bytes_read==0) || 
@@ -879,7 +880,8 @@ again:
 					req->start);
 #endif
 			if (unlikely(bytes==-1)){
-				LOG(L_ERR, "ERROR: tcp_read_req: error reading \n");
+				LOG(cfg_get(core, core_cfg, corelog),
+						"ERROR: tcp_read_req: error reading \n");
 				resp=CONN_ERROR;
 				goto end_req;
 			}