PHP code example of jitesoft / wp-logger

1. Go to this page and download the library: Download jitesoft/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/ */

    

jitesoft / wp-logger example snippets

 
$logger = jitesoft('logger'); // null if not lodaed
add_action('jitesoft_logger_loaded', static fn($logger) => $logger); // will not be null when loaded.
 
Jitesoft\WordPress\Plugins\Logger\GlobalLogger;

$logger = GlobalLogger::logger();
 
jitesoft('logger')->removeLogger('stdout');
jitesoft('logger')->removeLogger('json');

jitesoft('logger')->addLogger(new MyPsrLogger(), 'myLogger');
 
add_action('jitesoft_logger_loaded', static function($logger) {
    $logger->removeLogger('stdout');
    $logger->removeLogger('json');
    $logger->addLogger(new MyPsrLogger(), 'myLogger');
});