Browse code

modparam.c: logging: convert LOG to LM_*

Ovidiu Sas authored on 03/10/2014 20:48:57
Showing 1 changed files
... ...
@@ -64,18 +64,18 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
64 64
 	str s;
65 65
 
66 66
 	if (!regex) {
67
-		LOG(L_ERR, "set_mod_param_regex(): Invalid mod parameter value\n");
67
+		LM_ERR("Invalid mod parameter value\n");
68 68
 		return -5;
69 69
 	}
70 70
 	if (!name) {
71
-		LOG(L_ERR, "set_mod_param_regex(): Invalid name parameter value\n");
71
+		LM_ERR("Invalid name parameter value\n");
72 72
 		return -6;
73 73
 	}
74 74
 
75 75
 	len = strlen(regex);
76 76
 	reg = pkg_malloc(len + 2 + 1);
77 77
 	if (reg == 0) {
78
-		LOG(L_ERR, "set_mod_param_regex(): No memory left\n");
78
+		LM_ERR("No memory left\n");
79 79
 		return -1;
80 80
 	}
81 81
 	reg[0] = '^';
... ...
@@ -84,7 +84,7 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
84 84
 	reg[len + 2] = '\0';
85 85
 
86 86
 	if (regcomp(&preg, reg, REG_EXTENDED | REG_NOSUB | REG_ICASE)) {
87
-		LOG(L_ERR, "set_mod_param_regex(): Error while compiling regular expression\n");
87
+		LM_ERR("Error while compiling regular expression\n");
88 88
 		pkg_free(reg);
89 89
 		return -2;
90 90
 	}
... ...
@@ -123,7 +123,7 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
123 123
 						case PARAM_STRING:
124 124
 							*((char**)ptr) = pkg_malloc(strlen((char*)val2)+1);
125 125
 							if (!*((char**)ptr)) {
126
-								LOG(L_ERR, "set_mod_param_regex(): No memory left\n");
126
+								LM_ERR("No memory left\n");
127 127
 								regfree(&preg);
128 128
 								pkg_free(reg);
129 129
 								return -1;
... ...
@@ -134,7 +134,7 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
134 134
 						case PARAM_STR:
135 135
 							((str*)ptr)->s = pkg_malloc(((str*)val2)->len+1);
136 136
 							if (!((str*)ptr)->s) {
137
-								LOG(L_ERR, "set_mod_param_regex(): No memory left\n");
137
+								LM_ERR("No memory left\n");
138 138
 								regfree(&preg);
139 139
 								pkg_free(reg);
140 140
 								return -1;
... ...
@@ -151,9 +151,8 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
151 151
 				}
152 152
 			}
153 153
 			else {
154
-				LOG(L_ERR, "set_mod_param_regex: parameter <%s>"
155
-							" of type <%d> not found in"
156
-							" module <%s>\n", name, type, t->exports.name);
154
+				LM_ERR("parameter <%s> of type <%d> not found in module <%s>\n",
155
+						name, type, t->exports.name);
157 156
 				regfree(&preg);
158 157
 				pkg_free(reg);
159 158
 				return -3;
... ...
@@ -164,7 +163,7 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val)
164 164
 	regfree(&preg);
165 165
 	pkg_free(reg);
166 166
 	if (!mod_found) {
167
-		LOG(L_ERR, "set_mod_param_regex: No module matching <%s> found\n", regex);
167
+		LM_ERR("No module matching <%s> found\n", regex);
168 168
 		return -4;
169 169
 	}
170 170
 	return 0;