WP Simple Debug creates a simple function to allow developers to write to the WordPress debug.log.
Feature requests or bugs can be added to
the GitHub page.
产品特点
- Creates wpsd_log() function that allows you to log data to the WordPress debug.log
- Turns on debugging and logging
- By default outputs file path and line number where function is called from.
- Can output full backtrace to how function was called.
This section describes how to install the plugin and get it working.
- Upload the
wp-simple-debug
directory to your /wp-content/plugins/
directory
- 通过WordPress的的“Plugins”菜单激活插件
- Note: This will turn on WordPress debugging, which will show any errors in any other plugins or themes.
用法
After installing & activating the plugin...
- Use the function where you would like to in your code: wpsd_log( $data, $note, $file, $line, $full_backtrace )
- $data - required - mixed - The data you would like to log. This can be a string, array or object.
- $note - optional - string - Will log any note you'd like before outputting the data, such as a variable name. Default '';
- $file - optional - bool - If true, will output the path to file calling the function. Default true.
- $line - optional - bool - If true, will output the line in the file calling the function. Default true.
- $full_backtrace - optional - bool - If true, will output the full backtrace to how the function was called, then die to prevent excessive amounts of data being written. Default false.