| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/pojo-accessibility/classes/ |
Upload File : |
<?php
namespace EA11y\Classes;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Logger {
public const LEVEL_ERROR = 'error';
public const LEVEL_WARN = 'warn';
public const LEVEL_INFO = 'info';
private static function log( string $log_level, $message ): void {
$backtrace = debug_backtrace(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
$class = $backtrace[2]['class'] ?? null;
$type = $backtrace[2]['type'] ?? null;
$function = $backtrace[2]['function'];
if ( $class ) {
$message = '[EA11Y]: ' . $log_level . ' in ' . "$class$type$function()" . ': ' . $message;
} else {
$message = '[EA11Y]: ' . $log_level . ' in ' . "$function()" . ': ' . $message;
}
error_log( $message ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
}
public static function error( $message ): void {
self::log( self::LEVEL_ERROR, $message );
}
public static function info( $message ): void {
self::log( self::LEVEL_INFO, $message );
}
}