gruene-seele/dev/dhl-for-woocommerce/includes/class-pr-dhl-logger.php
Kevin Adametz 0f641ef33a Housekeeping: offene Dev-Dateien eingecheckt + Sidebar „Bestellungen"→„Versand"
- Sidebar-Menü „Bestellungen" in „Versand" umbenannt (layout-sidenav), sonst nur
  Blade-Formatierung.
- Entwicklungspläne in ISO-Datumsformat umbenannt (entwicklungsplan-aktualisiert-*).
- dev/dhl-for-woocommerce/ (DHL-Plugin) + dev/partnercenter-api.zip + PastedGraphic
  hinzugefügt.
- .claude/ bewusst NICHT eingecheckt (lokale Claude-Code-Konfiguration).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-28 12:04:41 +00:00

70 lines
1.2 KiB
PHP

<?php
if (! defined('ABSPATH')) {
exit;
} // Exit if accessed directly
class PR_DHL_Logger
{
/**
* @var string
*/
private $debug;
/**
* WC_DHL_Logger constructor.
*
* @param WC_XR_debug $debug
*/
public function __construct($debug)
{
$this->debug = $debug;
}
/**
* Check if logging is enabled
*
* @return bool
*/
public function is_enabled()
{
// Check if debug is on
if ($this->debug === 'yes') {
return true;
}
return false;
}
/**
* Write the message to log
*
* @param string $message
*/
public function write($message)
{
// Check if enabled
if ($this->is_enabled()) {
// Logger object
$wc_logger = new WC_Logger;
// Add to logger
$wc_logger->add('DHL', $message);
}
}
public function get_log_url()
{
return admin_url('admin.php?page=wc-status&tab=logs');
/*
$log_path = wc_get_log_file_path( 'DHL' );
$upload_path = wp_upload_dir();
$log_url = str_replace( $upload_path['basedir'], $upload_path['baseurl'], $log_path );
return $log_url;*/
}
}