| Server IP : 213.136.93.164 / Your IP : 216.73.216.20 Web Server : Apache System : Linux m14200.contabo.net 5.14.0-611.54.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 6 18:03:03 EDT 2026 x86_64 User : ki692510 ( 1047) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/ki692510/www/wp-content/plugins/image-optimization/classes/ |
Upload File : |
<?php
namespace ImageOptimization\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';
public static function log( string $log_level, $message ): void {
$backtrace = debug_backtrace(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
$class = $backtrace[1]['class'] ?? null;
$type = $backtrace[1]['type'] ?? null;
$function = $backtrace[1]['function'];
if ( $class ) {
$message = '[Image Optimizer]: ' . $log_level . ' in ' . "$class$type$function()" . ': ' . $message;
} else {
$message = '[Image Optimizer]: ' . $log_level . ' in ' . "$function()" . ': ' . $message;
}
error_log( $message ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
}
}