1. Go to this page and download the library: Download brianhenryie/bh-wp-logger library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
brianhenryie / bh-wp-logger example snippets
$logger = Logger::instance();
$logger = Logger::instance();
$logger_settings = new class() implements BrianHenryIE\WP_Logger\API\Logger_Settings_Interface {
use BrianHenryIE\WP_Logger\Logger_Settings_Trait;
public function get_log_level(): string {
return LogLevel::INFO;
}
// This is used in admin notices.
public function get_plugin_name(): string {
return "My Plugin Name";
}
// This is used in option names and URLs.
public function get_plugin_slug(): string {
return "my-plugin-name";
}
// This is needed for the plugins.php logs link.
public function get_plugin_basename(): string {
return "my-plugin-name/my-plugin-name.php";
}
};
$logger = Logger::instance( $logger_settings );
$logger_settings = new class() implements BrianHenryIE\WP_Logger\WooCommerce\WooCommerce_Logger_Settings_Interface {
...