LGP stands for "Lazy Guinea Pig."
Drupal debugging tools for slackers. Are you one too?
Features
Currently, LGP provides a set of tools to debug Drupal, including:
- Writing the given debug message to a temporary file, the LGP file.
- Having a low memory footprint, skipping the Database bottleneck.
- Being useful where Devel's dsm() does not work or when you need an alternative debug log. For example, while debugging services.module (instead of Services log) or during hook_init().
- Having a centralized debug file; the LGP file is shared by Drupal installations that use the same temporary directory.
Functions
LGP implements the following functions:
- lgp_print($message): Logs $message to the LGP file.
- Lazy Print: lp($var, $keys_only = FALSE): Logs the variable to the LGP file in print_r format. Alternatively, it prints keys only (if passed an array as an argument). Alias: lfp().
- Lazy Dump: ld($var): Logs $var to the LGP file in var_dump format. Alias: lfd().
- Lazy Export: lx($var): Logs $var to the LGP file in var_export format. Alias: lfx().
- Lazy Backtrace: lbt($ignore_args = TRUE): Logs the backtrace to the LGP file, without function arguments (default behavior, see debug_backtrace).
Drush Integration
LGP provides the following for Drush:
- lgp-console: Console watcher. Shows a log of functions: lfp(), lfd(), and lfx().
Alias: lgc
Usage:$ drush lgc # Linux and macOS
Note for **Windows users**: you will need UnixCore tail or Cygwin to watch the lgp.log file.
- Print the output of debug functions to stdout (available only from "drush ev"):
_lp() or _lfp() see lp()
_ld() or _lfd() see ld()
_lx() or _lfx() see lx()
_lbt() see lbt()Example:
$ drush ev "_lp(user_load(1))"
Where is the lgp.log file?
Visit the Status report; there you will find the file path to lgp.log.
Supporting organizations:
Maintainer sponsorship
Project information
- Module categories: Developer Tools
- Ecosystem: Drupal Developer
- 5 sites report using this module
- Created by DevElCuy on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
2.0.0
released 2 August 2023
Works with Drupal: ^10 | ^9
Install:
Development version: 2.0.x-dev updated 29 Aug 2023 at 04:53 UTC
7.x-1.0-beta1
released 8 February 2017
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.
1st BETA release of LGP 7.x-1.x.
Development version: 7.x-1.x-dev updated 8 Feb 2017 at 05:13 UTC