mirror of
https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2025-08-18 18:41:52 +08:00
Make debug-memory-usage WP-CLI friendly
This commit is contained in:
parent
5f99f6ddcd
commit
0078d8660e
1 changed files with 2 additions and 1 deletions
|
@ -16,7 +16,8 @@ add_action(
|
|||
$uri = isset($_SERVER['REQUEST_URI'])
|
||||
? wp_json_encode($_SERVER['REQUEST_URI'], JSON_UNESCAPED_SLASHES)
|
||||
: 'CLI';
|
||||
error_log(sprintf('Peak memory usage = %d bytes, %s', $peakUsage, $uri));
|
||||
$message = sprintf('Peak memory usage = %d bytes, %s', $peakUsage, $uri);
|
||||
(defined('WP_CLI') && WP_CLI) ? WP_CLI::debug($message) : error_log($message);
|
||||
},
|
||||
-1,
|
||||
0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue