Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
FileLogger.php1.28 kB
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Application\Logger; use Monolog\Handler\RotatingFileHandler; use Monolog\Level; use Monolog\Logger; use Monolog\Processor\TagProcessor; /** * @psalm-suppress InvalidExtendClass */ final class FileLogger extends Logger implements HasPrefixLoggerInterface { /** * @param non-empty-string $name * @param non-empty-string $filePath * @psalm-suppress ImplementedParamTypeMismatch * @psalm-suppress ConstructorSignatureMismatch * @psalm-suppress ParamNameMismatch * @psalm-suppress MethodSignatureMismatch * @psalm-suppress MoreSpecificImplementedParamType */ public function __construct(string $name, string $filePath, Level $level) { parent::__construct($name, [ new RotatingFileHandler(filename: $filePath, level: $level), ], [ new TagProcessor(), ]); } public function withPrefix(string $prefix): self { if ($this->getProcessors() !== []) { $this->popProcessor(); } $this->pushProcessor( (new TagProcessor())->addTags([$prefix]), ); return $this; } public function getPrefix(): string { return ''; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/context-hub/generator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server