The Object Log module allows developers to store objects, arrays and other variables to a log table so that they may be inspected later. Multiple stored variables may be displayed side-by-side in the Object Log under admin/reports.
The usage is similar to Devel module's dpm()
or kprint_r()
functions, but
is particularly suited for debugging server-to-server requests, such as cron
runs and web services, or for requests from anonymous and other unprivileged
users.
Other uses include where the use of dpm()
slows down the rendering of a page
to the extent where it is unusable or where Krumo is not able to render an
object.
When you reach a point in a code at which you would like to store a variable, call the object_log() function...
object_log($label, $data);
...where $label is a string representing a name to give the object in the log, and $data is the variable you wish to store. If there is already a stored object with the same $label, that entry will be overwritten in the log.
If you want to inspect the same object over time, you could append a date string or other identifier to the label to give distinct entries:
$label = 'object_label' . date('ymd_His')
object_log($label, $data);
Stored objects may be inspected by any user with the "access devel information" permission by going to admin/reports/object_log. While inspecting an object, a second object may be selected to display both objects side-by-side.
This module requires that the following modules are also enabled:
- Devel
- Install this module using the official Backdrop CMS instructions at https://docs.backdropcms.org/documentation/extend-with-modules.
Bugs and Feature Requests should be reported in the Issue Queue: https://github.com/backdrop-contrib/object_log/issues.
- Martin Price - System Horizons Ltd
- Collaboration and co-maintainers welcome!
- Ported to Backdrop CMS by - Martin Price - System Horizons Ltd.
- Port sponsored by System Horizons Ltd.
- Originally written for Drupal by Les Lim.
This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.