Minor fixes (#659)

This commit is contained in:
Roman Kelesidis 2023-03-27 22:41:05 +07:00 committed by GitHub
commit d806d12443
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -87,7 +87,7 @@ ini_set('error_reporting', E_ALL);
ini_set('display_errors', 0); ini_set('display_errors', 0);
ini_set('log_errors', 1); ini_set('log_errors', 1);
ini_set('error_log', LOG_DIR . '/php_errors.log'); // path to log file enabled only if log_errors == 1 (native) ini_set('error_log', LOG_DIR . '/php_errors.log'); // path to log file enabled only if log_errors == 1 (native)
define('WHOOPS_LOG_FILE', 'php_whoops'); // log file enabled only if log_errors == 1 (whoops) define('WHOOPS_LOG_FILE', LOG_DIR . '/php_whoops.log'); // log file enabled only if log_errors == 1 (whoops)
// Triggers // Triggers
define('BB_ENABLED', TRIGGERS_DIR . '/$on'); define('BB_ENABLED', TRIGGERS_DIR . '/$on');

View file

@ -57,7 +57,7 @@ class Dev
*/ */
$loggingInConsole = new PlainTextHandler(); $loggingInConsole = new PlainTextHandler();
$loggingInConsole->loggerOnly(true); $loggingInConsole->loggerOnly(true);
$loggingInConsole->setLogger((new Logger(getenv('APP_NAME', 'TorrentPier'), [(new BrowserConsoleHandler())->setFormatter((new LineFormatter(null, null, true)))]))); $loggingInConsole->setLogger((new Logger(env('APP_NAME', 'TorrentPier'), [(new BrowserConsoleHandler())->setFormatter((new LineFormatter(null, null, true)))])));
$whoops->pushHandler($loggingInConsole); $whoops->pushHandler($loggingInConsole);
/** /**
@ -66,7 +66,7 @@ class Dev
if (ini_get('log_errors') == 1) { if (ini_get('log_errors') == 1) {
$loggingInFile = new PlainTextHandler(); $loggingInFile = new PlainTextHandler();
$loggingInFile->loggerOnly(true); $loggingInFile->loggerOnly(true);
$loggingInFile->setLogger((new Logger(getenv('APP_NAME', 'TorrentPier'), [(new StreamHandler(bb_log('', WHOOPS_LOG_FILE, true)))->setFormatter((new LineFormatter(null, null, true)))]))); $loggingInFile->setLogger((new Logger(env('APP_NAME', 'TorrentPier'), [(new StreamHandler(WHOOPS_LOG_FILE))->setFormatter((new LineFormatter(null, null, true)))])));
$whoops->pushHandler($loggingInFile); $whoops->pushHandler($loggingInFile);
} }