Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
LoggerFactory.php1.21 kB
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Application\Logger; use Butschster\ContextGenerator\Application\FSPath; use Monolog\Level; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\OutputInterface; final class LoggerFactory { public static function create( FSPath $logsPath, ?OutputInterface $output = null, bool $loggingEnabled = true, ): LoggerInterface { // If logging is disabled, return a NullLogger if (!$loggingEnabled) { return new NullLogger(); } // If no output is provided, return a NullLogger if ($output === null) { $output = new NullOutput(); } // Create the output logger with the formatter return new FileLogger( name: 'ctx', filePath: (string) $logsPath->join('ctx.log'), level: match (true) { $output->isVeryVerbose() => Level::Debug, $output->isVerbose() => Level::Info, $output->isQuiet() => Level::Error, default => Level::Debug, }, ); } }

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