Added LogLib2 support

This commit is contained in:
netkas 2025-01-22 13:18:55 -05:00
parent 5afe4429ed
commit a3456bdeed
7 changed files with 102 additions and 80 deletions

View file

@ -3,10 +3,13 @@
namespace Socialbox;
use OptsLib\Parse;
use Socialbox\Classes\Logger;
use Socialbox\Enums\CliCommands;
class Program
{
private static ?\LogLib2\Logger $logger;
/**
* Socialbox main entry point
*
@ -73,4 +76,20 @@
return 0;
}
/**
* Retrieves the logger instance for the Socialbox program.
*
* @return \LogLib2\Logger Returns the logger instance.
*/
public static function getLogger(): \LogLib2\Logger
{
if(self::$logger === null)
{
self::$logger = new \LogLib2\Logger('net.nosial.socialbox');
\LogLib2\Logger::registerHandlers();
}
return self::$logger;
}
}