wordpress-event-bridge-for-.../includes/class-debug.php
André Menrath 8026ea69f4
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 47s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Failing after 59s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Failing after 1m25s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 57s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 58s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 59s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Failing after 57s
phpcs
2025-01-04 10:40:00 +01:00

38 lines
796 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 ) );
}
}