r82052 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82051‎ | r82052 | r82053 >
Date:11:15, 13 February 2011
Author:catrope
Status:ok
Tags:
Comment:
wmerrors: Make writing concise backtrace to error log configurable
Modified paths:
  • /trunk/php/wmerrors/php_wmerrors.h (modified) (history)
  • /trunk/php/wmerrors/wmerrors.c (modified) (history)

Diff [purge]

Index: trunk/php/wmerrors/wmerrors.c
@@ -55,6 +55,7 @@
5656 STD_PHP_INI_ENTRY("wmerrors.logging_file", "", PHP_INI_ALL, OnUpdateString, logging_file, zend_wmerrors_globals, wmerrors_globals)
5757 STD_PHP_INI_ENTRY("wmerrors.log_level", "0", PHP_INI_ALL, OnUpdateLong, log_level, zend_wmerrors_globals, wmerrors_globals)
5858 STD_PHP_INI_BOOLEAN("wmerrors.ignore_logging_errors", "0", PHP_INI_ALL, OnUpdateBool, ignore_logging_errors, zend_wmerrors_globals, wmerrors_globals)
 59+ STD_PHP_INI_BOOLEAN("wmerrors.concise_backtrace_in_error_log", "0", PHP_INI_ALL, OnUpdateBool, concise_backtrace_in_error_log, zend_wmerrors_globals, wmerrors_globals)
5960 PHP_INI_END()
6061
6162 void (*old_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
@@ -157,8 +158,8 @@
158159 }
159160
160161 /* Put a concise backtrace in the normal output */
161 - /* TODO: Make configurable */
162 - wmerrors_get_backtrace(&new_filename);
 162+ if (WMERRORS_G(concise_backtrace_in_error_log))
 163+ wmerrors_get_backtrace(&new_filename);
163164 smart_str_appendl(&new_filename, error_filename, strlen(error_filename));
164165 smart_str_0(&new_filename);
165166
Index: trunk/php/wmerrors/php_wmerrors.h
@@ -30,6 +30,7 @@
3131 int enabled;
3232 long int log_level;
3333 int ignore_logging_errors;
 34+ int concise_backtrace_in_error_log;
3435 smart_str log_buffer;
3536 ZEND_END_MODULE_GLOBALS(wmerrors)
3637

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82046wmerrors: Use a dirty hack to add concise backtraces (formatted as Foo.php:12...catrope00:35, 13 February 2011

Status & tagging log