# phastpress/3.12/classes/Compat/Log.php

PhastPress, version 3.12. 31 lines.

- Page: https://pluginprobe.com/plugins/phastpress/3.12/code/classes/Compat/Log.php
- Raw: https://pluginprobe.com/plugins/phastpress/3.12/raw/classes/Compat/Log.php
- Modified: 2022-08-06T12:24:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/phastpress/3.12/code/classes/Compat/Log.php#L10-L20`.

```php
<?php
namespace Kibo\PhastPlugins\PhastPress\Compat;

class Log {
    private static $messages;

    public static function setup() {
        add_action('wp_head', __CLASS__ . '::output');
    }

    public static function add($plugin, $message) {
        self::$messages[$plugin][] = $message;
    }

    public static function output() {
        if (empty(self::$messages)) {
            return;
        }

        $o = 'console.group("[PhastPress] Plugin compatibility");';
        foreach (self::$messages as $plugin => $messages) {
            foreach ($messages as $message) {
                $o .= 'console.log(' . json_encode($plugin ? "{$plugin}: {$message}" : $message) . ');';
            }
        }
        $o .= 'console.groupEnd();';

        echo phastpress_script($o, ['data-phast-no-defer' => '']);
    }
}

```
