wordpress-event-bridge-for-.../includes/class-debug.php
André Menrath 21d1ee9915
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 45s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Failing after 57s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Failing after 57s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 56s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 51s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 55s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Failing after 52s
Refactor outbox parsing and add some debug logs
2025-01-04 10:39:12 +01:00

38 lines
No EOL
795 B
PHP

<?php
/**
* Class file for Debug Class.
*
* @package Event_Bridge_For_ActivityPub
* @since 1.0.0
* @license AGPL-3.0-or-later
*/
namespace Event_Bridge_For_ActivityPub;
/**
* Debug Class.
*
* @package Event_Bridge_For_ActivityPub
* @since 1.0.0
* @license AGPL-3.0-or-later
*/
class Debug {
/**
* Initialize the class, registering WordPress hooks.
*/
public static function init() {
if ( defined( 'WP_DEBUG_LOG' ) && constant( 'WP_DEBUG_LOG' ) ) {
\add_action( 'event_bridge_for_activitypub_write_log', array( self::class, 'write_log' ), 10, 1 );
}
}
/**
* Write a log entry.
*
* @param mixed $log The log entry.
*/
public static function write_log( $log ) {
// phpcs:ignore WordPress.PHP.DevelopmentFunctions
\error_log( \print_r( $log, true ) );
}
}