Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

LGP

Security covered
View on drupal.org

LGP (Lazy Guinea Pig) is a set of debugging tools designed for Drupal developers who need a straightforward and efficient way to log debug messages.

Features

LGP offers a variety of tools to help you debug Drupal more effectively:

  • Temporary Debug File: Logs debug messages to a temporary file called the LGP file.
  • Low Memory Usage: Operates with a minimal memory footprint, avoiding database bottlenecks.
  • Alternative to Devel: Useful when Devel's dsm() doesn't work or when an alternative debug log is needed, such as when debugging services.module or during hook_init().
  • Centralized Debugging: Shares the LGP file across Drupal installations that use the same temporary directory.

Functions

LGP includes the following functions to log various types of debug information:

  • lgp_print($message): Logs a message to the LGP file.
  • Lazy Print: lp($var, $keys_only = FALSE): Logs a variable in print_r format. Optionally logs only the keys if passed an array. Alias: lfp().
  • Lazy Dump: ld($var): Logs a variable in var_dump format. Alias: lfd().
  • Lazy Export: lx($var): Logs a variable in var_export format. Alias: lfx().
  • Lazy Backtrace: lbt($ignore_args = TRUE): Logs the backtrace without function arguments by default. Alias: lfbt(). See debug_backtrace.

Drush Integration

LGP integrates with Drush, providing additional tools for command-line debugging:

  • lgp-console: A console watcher that shows logs of functions lfp(), lfd(), and lfx(). Alias: lgc.

    Usage:

    $ drush lgc # Linux and macOS
    

    Windows Users: You'll need UnixCore tail or Cygwin to watch the lgp.log file.

  • Drush Debug Functions: Print the output of debug functions to stdout (only available from "drush ev"):

    _lp() or _lfp() for lp()

    _ld() or _lfd() for ld()

    _lx() or _lfx() for lx()

    _lbt() for lbt()

    Example:

    $ drush ev "_lp(user_load(1))"

Locating the lgp.log File

You can find the path to the lgp.log file in the Status report.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0 Stable Aug 2, 2023
2.0.x-dev Dev Aug 2, 2023