Add option to disable error reporting

(imported from commit 3621aa6e7a5badd21b22891026285099db393df0)
This commit is contained in:
Kevin Mehall 2013-11-13 15:35:04 -05:00
parent 08cc6378af
commit 98caa8eaf1
3 changed files with 10 additions and 1 deletions

View File

@ -1931,6 +1931,9 @@ def json_report_error(request, user_profile, message=REQ, stacktrace=REQ,
href=REQ, log=REQ,
more_info=REQ(converter=json_to_dict, default=None)):
if not settings.ERROR_REPORTING:
return json_success()
if js_source_map:
stacktrace = js_source_map.annotate_stacktrace(stacktrace)

View File

@ -45,6 +45,10 @@ EMAIL_USE_TLS = True
# which can be used to send feedback directly to Zulip
ENABLE_FEEDBACK = True
# Control whether or not error reports are sent to Zulip. Error reports
# do not include message content.
ERROR_REPORTING = True
# By default uploaded files and avatars are stored directly on the Zulip server
# If file storage to Amazon S3 is desired, please contact Zulip Support
# (support@zulip.com) for further instructions on setting up S3 integration

View File

@ -245,6 +245,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
'MAILCHIMP_API_KEY': '',
'LOCAL_UPLOADS_DIR': None,
'DROPBOX_APP_KEY': '',
'ERROR_REPORTING': True,
# The following bots only exist in non-ENTERPRISE installs
'ERROR_BOT': None,
'NEW_USER_BOT': None,
@ -653,7 +654,8 @@ LOGGING = {
'propagate': False,
},
'django': {
'handlers': ['zulip_admins', 'console', 'file'],
'handlers': (['zulip_admins'] if ERROR_REPORTING else [])
+ ['console', 'file'],
'level': 'INFO',
'propagate': False,
},