Added proper logging and error handling

This commit is contained in:
2020-12-27 19:26:38 +00:00
parent 03cd015f12
commit 33eb4021fa
10 changed files with 160 additions and 21 deletions

View File

@@ -1,5 +1,8 @@
<?php
use Analog\Analog;
use Analog\Handler\File;
require realpath(__DIR__ . '/../../vendor/autoload.php');
$dotenv = Dotenv\Dotenv::createImmutable(realpath(__DIR__ . '/../../'));
@@ -10,3 +13,7 @@ $dotenv->required('COMMAND_PREFIX')->notEmpty();
$dotenv->required('CAT_API_KEY')->notEmpty();
define('PROJECT_ROOT', realpath(__DIR__ . '/../../'));
Analog::handler(File::init(PROJECT_ROOT . 'Storage/Logs/bot.log'));
Analog::info("Finished intializing configuration and dependencies.");