Permalink
Browse files

Fixed logging (Now logging autostarting without special loggerconfig.…

…php). Issue #59.
  • Loading branch information...
corpsee committed May 23, 2017
1 parent 5a761dc commit 7e2f63142d87c9de43a14911730d42b5e82f2e2b
View
@@ -1,6 +1,5 @@
/vendor
/composer.phar
/runtime
/app/loggerconfig.php
/app/config.yml
/public/assets/vendor

This file was deleted.

Oops, something went wrong.
View
@@ -9,7 +9,6 @@ Getting Started
* [Run builds using a worker](workers/worker.md)
* [Run builds using cronjob](workers/cron.md)
* [Adding PHP Censor Support to Your Projects](configuring_project.md)
* [Setting up Logging](logging.md)
* Updating PHP Censor (See [README](../../README.md))
* [Configuring PHP Censor](configuring.md)
View

This file was deleted.

Oops, something went wrong.
@@ -4,6 +4,8 @@
use b8\Config;
use b8\Store\Factory;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use PHPCensor\Command\CreateAdminCommand;
use PHPCensor\Command\CreateBuildCommand;
use PHPCensor\Command\InstallCommand;
@@ -40,7 +42,13 @@ public function __construct($name = 'PHP Censor - Continuous Integration for PHP
{
parent::__construct($name, $version);
$loggerConfig = LoggerConfig::newFromFile(APP_DIR . 'loggerconfig.php');
$loggerConfig = new LoggerConfig([
"_" => function() {
return [
new StreamHandler(RUNTIME_DIR . 'console.log', Logger::DEBUG),
];
}
]);
$applicationConfig = Config::getInstance();
$databaseSettings = $applicationConfig->get('b8.database', []);
@@ -13,23 +13,6 @@ class LoggerConfig
private $config;
private $cache = [];
/**
* The filepath is expected to return an array which will be
* passed to the normal constructor.
*
* @param string $filePath
* @return LoggerConfig
*/
public static function newFromFile($filePath)
{
if (file_exists($filePath)) {
$configArray = require($filePath);
} else {
$configArray = [];
}
return new self($configArray);
}
/**
* Each key of the array is the name of a logger. The value of
* each key should be an array or a function that returns an

0 comments on commit 7e2f631

Please sign in to comment.