LGP
Component ID
1710708
Component name
LGP
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Downloads
1590
Component created
Component changed
Component body
Acronym of "Lazy Guinea Pig".
Created by the laziest, LGP is a Drupal library for slackers. Aren't you?
Features
ATM, LGP provides a set of tools to debug Drupal.
- Write given debug message to a temporary file, the LGP file
- Low memory footprint, skip Database bottleneck
- Useful where Devel's dsm() does not works or when you need an alternative debug log, by example: while debugging services.module (instead of Services log) or during hook_init().
- Centralized debug file, LGP file is shared by drupal installations that use same temporary directory
Functions
LGP implements the following functions:
- lgp_print($message): Log $message to LGP file.
- Lazy print: lp($var, $keys_only = FALSE): Log to LGP file in print_r format. Alternatively print keys only (if passed an array as argument) Alias: lfp().
- Lazy dump: ld($var): Log $var to LGP file in var_dump format. Alias: lfd().
- Lazy export: lx($var): Log $var to LGP file in var_export format. Alias: lfx().
- Lazy backtrace: lbt($ignore_args = TRUE): Log backtrace to LGP file, without functions arguments (default behavior see debug_backtrace)
Drush integration
LGP provides the following for drush:
- lgp-console: Console watcher. Shows log of functions: lfp(), lfd() and lfx().
Alias: lgc
Usage:$ drush lgc #Linux and OS X
Note for **Windows users**: you will need UnixCore tail or Cygwin in order 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.
