qqq
This commit is contained in:
@@ -47,7 +47,7 @@ abstract class BaseApplication extends Component
|
|||||||
$this->localService = make(LocalService::class);
|
$this->localService = make(LocalService::class);
|
||||||
|
|
||||||
/** @var ConfigProvider $config */
|
/** @var ConfigProvider $config */
|
||||||
$config = instance(ConfigProvider::class, [sweep(APP_PATH . '/config')]);
|
$config = make(ConfigProvider::class);
|
||||||
|
|
||||||
$this->mapping($config);
|
$this->mapping($config);
|
||||||
$this->parseStorage($config);
|
$this->parseStorage($config);
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ class Logger implements LoggerInterface
|
|||||||
private array $levels = [];
|
private array $levels = [];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->levels = \config('log.level', Logger::LOGGER_LEVELS);
|
$this->levels = \config('log.level', Logger::LOGGER_LEVELS);
|
||||||
@@ -176,8 +179,14 @@ class Logger implements LoggerInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$console = Kiri::getDi()->get(OutputInterface::class);
|
$container = Kiri::getDi();
|
||||||
$console->writeln($_string);
|
if ($container->has(OutputInterface::class)) {
|
||||||
|
$console = $container->get(OutputInterface::class);
|
||||||
|
$console->writeln($_string);
|
||||||
|
} else {
|
||||||
|
file_put_contents('php://output', $message . PHP_EOL);
|
||||||
|
}
|
||||||
|
|
||||||
$filename = storage('log-' . date('Y-m-d') . '.log', 'log/');
|
$filename = storage('log-' . date('Y-m-d') . '.log', 'log/');
|
||||||
|
|
||||||
file_put_contents($filename, $_string, FILE_APPEND);
|
file_put_contents($filename, $_string, FILE_APPEND);
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ class ConfigProvider
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $config
|
*
|
||||||
*/
|
*/
|
||||||
public function __construct(array $config)
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->hashMap = new HashMap();
|
$this->hashMap = new HashMap();
|
||||||
$this->load($config);
|
$this->load(sweep(APP_PATH . '/config'));
|
||||||
|
|
||||||
$this->enableEnvConfig(APP_PATH . '.env');
|
$this->enableEnvConfig(APP_PATH . '.env');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user