#1419652: JavaScript logging and error reporting
This patch adds a Drupal.log(message, type)
function that wraps around the console object and falls back to alert for retarded browsers.
Types available are the same as in drupal_set_message()
, each is mapped to the relevant console method: status
is console.log()
, warning
is console.warn()
and error
is console.error()
, unknown types just add a 'mycustomtype: '
prefix to the message.
I'm using values from error_level to choose which error to display with a catch
ERROR_REPORTING_HIDE
displays nothing,ERROR_REPORTING_DISPLAY_SOME
(which is called Errors and warnings in the admin form) only displays warnings.ERROR_REPORTING_DISPLAY_ALL
All of the above plus errors.
There will be changes to make to this patch but i'm not sure at which level, I need some help integrating this properly. I'm not talking about a watchdog interface there are other issues for it.
Comment | File | Size | Author |
---|---|---|---|
core-js-error-reporting-piggy-back.patch | 2.51 KB | nod_ | |
Comments
Comment #2
nod_core-js-error-reporting-piggy-back.patch queued for re-testing.
Comment #4
effulgentsia CreditAttribution: effulgentsia commentedSee #1232416-58: Drupal alerts "An AJAX HTTP request terminated abnormally" during normal site operation, confusing site visitors/editors. I recommend merging this work into there and then closing this as a duplicate. It's always nice to have a use-case in the same patch as a new function, and that issue has as good a one as any, in my opinion.
Comment #5
TS79 CreditAttribution: TS79 commented@nod_: I think the constant ERROR_REPORTING_DISPLAY_ALL is not in scope in drupal_add_js().
Try to load it into scope with the following line in front of the array definition in drupal_add_js().
Comment #6
nod_New patch in #1232416-59: Drupal alerts "An AJAX HTTP request terminated abnormally" during normal site operation, confusing site visitors/editors. Closing this one.
Comment #6.0
nod_link to meta