이 플러그인은 최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다. 워드프레스의 좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 있을 수 있습니다.

WordPress Logger

설명

Display log messages from PHP in the browser console in Safari, Firefox (with firebug), and Opera (with the new Dragonfly debugging environment). Essential debugging tool for
plugin and theme developers. You no longer have to use ‘print_r’ statements from PHP to figure out what is going
on in the code, which more often than not, messes up the DOM and HTML layout. Displays complex PHP structures like arrays and objects
in pretty print.

Features

  • Log debug messages directly from themes and plugins.
  • Display log messages in the browser console, without muddying up the browser display.
  • Displays complex structures such as arrays and objects in pretty print.
  • Shows the line number and file from where the message was logged ( you won’t lose track of log statements ).

For more info, comments, and feature requests, visit the plugin homepage.

Credits

Code that forces the wplogger plugin to load first was adapted from the WordPress
FirePHP plugin
developed by Ivan Weiller.

This plugin is based on PEAR Log, the logging framework that is part of the
PHP PEAR library. Current maintainers Jon Parise, Jan Schneider, and Chuck Hagenbuch. PEAR Log is based on code first
developed for the Horde 1.3 framework – original authors Chuck Hagenbuch, and Jon Parise.

Release Notes

0.3 : Added support for Opera ;

0.2.2 : Fixed formatting issues in readme.txt file;

0.2.1 : Added more detail to the readme.txt file;

0.2 : First official public release;

0.1 : First internal release;

스크린샷

  • Console log output in the Firefox Browser with the Firebug extension.
  • Console log output in the Safari Browser.
  • Opera Dragonfly Error Console output in the Opera Browser.

설치

Installing from the Admin Panel

  1. Select the Add New subpanel from the Plugins panel.
  2. Type in “wordpress-logger” in the search field and click the Search button.
  3. Identify the “WordPress Logger” from the plugin list and click on its install action.
  4. Click on the Install Now button in the resulting dialog.
  5. Click on the Activate Plugin link.

Installing manually

  1. Verify that you have PHP5, which is required for this plugin.
  2. Upload the whole wordpress-logger folder into the /wp-content/plugins/ directory.
  3. Activate the plugin through the Plugins panel in WordPress.

Requirements

  • Make sure that your theme template has a footer ( index.php should have a get_footer() function call at the end).
  • Turn on the console in your browser:
    • Firefox: The Firebug extension needs to be installed and activated.
    • Safari: Show the Error Console from the Debug/Develop menu. See FAQ section for details on how to enable the Debug menu.

Usage

After activating the plugin, the following PHP function call can log any PHP expression to the console log.

     $wplogger->log( php_expression [, message_type] );

The message_type is optional and can be any one of the following constants:

  • WPLOG_ERR
  • WPLOG_WARNING
  • WPLOG_INFO
  • WPLOG_DEBUG

Examples

Logging from template files – inside the loop to display post IDs.

    <?php $wplogger->log( 'Post ID: '.$post->ID ); ?>

    Output:

    [Information: from line 20 in file index.php] Post ID: 125
    [Information: from line 20 in file index.php] Post ID: 116
    [Information: from line 20 in file index.php] Post ID: 65

Logging from PHP files (e.g. functions.php) ( always a good idea to check if $wplogger is available ). Note the message type set to warning through the second parameter.

    if ($wplogger) $wplogger->log( get_option('active_plugins'), WPLOG_WARNING );

    Output:

    [Warning: from line 55 in file functions.php] array (
          0 => 'wplogger/wplogger.php',
          1 => '12seconds-widget/12seconds-widget.php',
          2 => 'get-the-image/get-the-image.php',
    )

Logging from plugins – inside a plugin function. Note the global statement to get $wplogger into current scope.

    global $wplogger; $wplogger->log( 'No images attached to this post', WPLOG_ERR );

    Output:

    [Error: from line 206 in file get-the-image.php] No images attached to this post

FAQ

How to enable the *Debug* / *Develop* menu in Safari?
How to show the error console in Opera?
  1. Select the Tools > Advanced > Developer Tools menu.
  2. Click on the Error Console tab in the Opera Dragonfly console.

후기

이 플러그인에 대한 평가가 없습니다.

기여자 & 개발자

“WordPress Logger”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “WordPress Logger”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.