Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Begin building the query.
- $query = db_select('watchdog', 'th')
- ->extend('PagerDefault')
- ->orderBy('wid')
- ->distinct()
- ->fields('th', array('variables', 'type', 'severity', 'message'))
- ->limit(2000);
- // Fetch the result set.
- $result = $query -> execute();
- // Loop through each item and add to $row
- foreach ($result as $row) {
- blablabla($row);
- }
- function
- blablabla($row) {
- $severity = $row -> severity;
- $type = $row -> type;
- $message = $row -> message;
- ?>
- %type: !message in %function (line %line of %file)...
- %type: !message in %function (line %line of %file)...
- blablabla($row) {
- $variables = unserialize($row->variables); // un serialize variables
- $message = t($row->message, array(
- 'type' => $row->type,
- 'severity'=> $row->severity,
- // replace the rest of the variables
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement