updated plugin Connect Matomo version 1.1.5
This commit is contained in:
@ -1,27 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace WP_Piwik\Logger;
|
||||
|
||||
class Screen extends \WP_Piwik\Logger {
|
||||
|
||||
private $logs = array();
|
||||
|
||||
private function formatMicrotime($loggerTime) {
|
||||
return sprintf('[%6s sec]',number_format($loggerTime,3));
|
||||
}
|
||||
|
||||
public function __construct($loggerName) {
|
||||
add_action(is_admin()?'admin_footer':'wp_footer', array($this, 'echoResults'));
|
||||
parent::__construct($loggerName);
|
||||
}
|
||||
|
||||
public function loggerOutput($loggerTime, $loggerMessage) {
|
||||
$this->logs[] = $this->formatMicrotime($loggerTime).' '.$loggerMessage;
|
||||
}
|
||||
|
||||
public function echoResults() {
|
||||
echo '<pre>';
|
||||
print_r($this->logs);
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
namespace WP_Piwik\Logger;
|
||||
|
||||
class Screen extends \WP_Piwik\Logger {
|
||||
|
||||
private $logs = array();
|
||||
|
||||
private function format_microtime( $logger_time ) {
|
||||
return sprintf( '[%6s sec]', number_format( $logger_time, 3 ) );
|
||||
}
|
||||
|
||||
public function __construct( $logger_name ) {
|
||||
add_action( is_admin() ? 'admin_footer' : 'wp_footer', array( $this, 'echo_results' ) );
|
||||
parent::__construct( $logger_name );
|
||||
}
|
||||
|
||||
public function logger_output( $logger_time, $logger_message ) {
|
||||
$this->logs[] = $this->format_microtime( $logger_time ) . ' ' . $logger_message;
|
||||
}
|
||||
|
||||
public function echo_results() {
|
||||
echo '<pre>';
|
||||
print_r( $this->logs );
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user