mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-26 08:51:13 -06:00
Reduced duplication by creating a function that builds test logger config
This commit is contained in:
parent
562110fac4
commit
d7523bcb57
@ -82,6 +82,18 @@ $buildDbConnection = function (): array {
|
||||
return $driverConfigMap[$driver] ?? [];
|
||||
};
|
||||
|
||||
$buildTestLoggerConfig = fn (string $handlerName, string $filename) => [
|
||||
'handlers' => [
|
||||
$handlerName => [
|
||||
'name' => StreamHandler::class,
|
||||
'params' => [
|
||||
'level' => Logger::DEBUG,
|
||||
'stream' => sprintf('data/log/api-tests/%s', $filename),
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
return [
|
||||
|
||||
'debug' => true,
|
||||
@ -166,28 +178,8 @@ return [
|
||||
],
|
||||
|
||||
'logger' => [
|
||||
'Shlink' => [
|
||||
'handlers' => [
|
||||
'shlink_handler' => [
|
||||
'name' => StreamHandler::class,
|
||||
'params' => [
|
||||
'level' => Logger::DEBUG,
|
||||
'stream' => 'data/log/api-tests/shlink.log',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'Access' => [
|
||||
'handlers' => [
|
||||
'access_handler' => [
|
||||
'name' => StreamHandler::class,
|
||||
'params' => [
|
||||
'level' => Logger::DEBUG,
|
||||
'stream' => 'data/log/api-tests/access.log',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'Shlink' => $buildTestLoggerConfig('shlink_handler', 'shlink.log'),
|
||||
'Access' => $buildTestLoggerConfig('access_handler', 'access.log'),
|
||||
],
|
||||
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user