diff options
| author | xXx-caillou-xXx | 2018-08-28 14:24:29 +0200 |
|---|---|---|
| committer | jvoisin | 2018-08-28 12:24:29 +0000 |
| commit | aa5d6895d0ac8c6ea050a8ea55e2f8a39ddfe365 (patch) | |
| tree | c640e50ab007bae3a2fd55ca05bc13c73e293c69 /src/sp_config.c | |
| parent | eff2c658d37108020215f838d4c47c176ec3e050 (diff) | |
Use php's logging functions
This commit replace our usage of `php_log_err` with `zend_error`. This should
allow administrators to display errors in the webpage, should they want to;
and to properly manipulate the verbosity's level.
This should close #217
Diffstat (limited to 'src/sp_config.c')
| -rw-r--r-- | src/sp_config.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sp_config.c b/src/sp_config.c index e5cb3ce..2480362 100644 --- a/src/sp_config.c +++ b/src/sp_config.c | |||
| @@ -40,7 +40,7 @@ static int parse_line(char *line) { | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | if (strncmp(ptr, SP_TOKEN_BASE, strlen(SP_TOKEN_BASE))) { | 42 | if (strncmp(ptr, SP_TOKEN_BASE, strlen(SP_TOKEN_BASE))) { |
| 43 | sp_log_err("config", "Invalid configuration prefix for '%s' on line %zu.", | 43 | sp_log_err("config", "Invalid configuration prefix for '%s' on line %zu", |
| 44 | line, sp_line_no); | 44 | line, sp_line_no); |
| 45 | return -1; | 45 | return -1; |
| 46 | } | 46 | } |
| @@ -51,7 +51,7 @@ static int parse_line(char *line) { | |||
| 51 | return sp_func[i].func(ptr + strlen(sp_func[i].token)); | 51 | return sp_func[i].func(ptr + strlen(sp_func[i].token)); |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| 54 | sp_log_err("config", "Invalid configuration section '%s' on line %zu.", line, | 54 | sp_log_err("config", "Invalid configuration section '%s' on line %zu", line, |
| 55 | sp_line_no); | 55 | sp_line_no); |
| 56 | return -1; | 56 | return -1; |
| 57 | } | 57 | } |
| @@ -114,7 +114,7 @@ int parse_php_type(char *restrict line, char *restrict keyword, void *retval) { | |||
| 114 | "%s) is expecting a valid php type ('false', 'true'," | 114 | "%s) is expecting a valid php type ('false', 'true'," |
| 115 | " 'array'. 'object', 'long', 'double', 'null', 'resource', " | 115 | " 'array'. 'object', 'long', 'double', 'null', 'resource', " |
| 116 | "'reference'," | 116 | "'reference'," |
| 117 | " 'undef') on line %zu.", | 117 | " 'undef') on line %zu", |
| 118 | keyword, sp_line_no); | 118 | keyword, sp_line_no); |
| 119 | return -1; | 119 | return -1; |
| 120 | } | 120 | } |
| @@ -149,7 +149,7 @@ int parse_cidr(char *restrict line, char *restrict keyword, void *retval) { | |||
| 149 | *(sp_cidr **)retval = cidr; | 149 | *(sp_cidr **)retval = cidr; |
| 150 | return consumed; | 150 | return consumed; |
| 151 | } else { | 151 | } else { |
| 152 | sp_log_err("config", "%s doesn't contain a valid cidr on line %zu.", line, | 152 | sp_log_err("config", "%s doesn't contain a valid cidr on line %zu", line, |
| 153 | sp_line_no); | 153 | sp_line_no); |
| 154 | return -1; | 154 | return -1; |
| 155 | } | 155 | } |
| @@ -174,7 +174,7 @@ int parse_regexp(char *restrict line, char *restrict keyword, void *retval) { | |||
| 174 | closing_paren[0] = '\0'; | 174 | closing_paren[0] = '\0'; |
| 175 | } | 175 | } |
| 176 | sp_log_err("config", | 176 | sp_log_err("config", |
| 177 | "'%s)' is expecting a valid regexp, and not '%s' on line %zu.", | 177 | "'%s)' is expecting a valid regexp, and not '%s' on line %zu", |
| 178 | keyword, line, sp_line_no); | 178 | keyword, line, sp_line_no); |
| 179 | return -1; | 179 | return -1; |
| 180 | } | 180 | } |
