| Current Path : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/src/ |
| Current File : /home/jeromecohp/www/plugins/system/yooessentials/modules/core/src/Logger.php |
<?php
/**
* @package Essentials YOOtheme Pro (Freemium) 2.0.19 build 1026.0920
* @author ZOOlanders https://www.zoolanders.com
* @copyright Copyright (C) Joolanders, SL
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
namespace ZOOlanders\YOOessentials;
class Logger extends Data
{
/**
* @var array
*/
public static $loggers = [];
public function __construct(string $id)
{
$this->id = $id;
$this->entries = [];
}
public static function createLogger(string $id, string $group): self
{
self::$loggers[$group] = self::$loggers[$group] ?? [];
if (isset(self::$loggers[$group][$id])) {
return self::$loggers[$group][$id];
}
return self::$loggers[$group][$id] = new Logger($id);
}
public function logEntry(string $id, array $args): void
{
$this->data['entries'][] = compact('id') + $args;
}
}