namespace Friendica\Factory;
-use Friendica\Core\Config\Configuration;
+use Friendica\Core\Config\IConfig;
use Friendica\Core\Logger;
use Friendica\Database\Database;
use Friendica\Network\HTTPException\InternalServerErrorException;
+use Friendica\Util\FileSystem;
use Friendica\Util\Introspection;
use Friendica\Util\Logger\Monolog\DevelopHandler;
use Friendica\Util\Logger\Monolog\IntrospectionProcessor;
/**
* Creates a new PSR-3 compliant logger instances
*
- * @param Database $database The Friendica Database instance
- * @param Configuration $config The config
- * @param Profiler $profiler The profiler of the app
+ * @param Database $database The Friendica Database instance
+ * @param IConfig $config The config
+ * @param Profiler $profiler The profiler of the app
+ * @param FileSystem $fileSystem FileSystem utils
*
* @return LoggerInterface The PSR-3 compliant logger instance
*/
- public function create( Database $database, Configuration $config, Profiler $profiler)
+ public function create(Database $database, IConfig $config, Profiler $profiler, FileSystem $fileSystem)
{
if (empty($config->get('system', 'debugging', false))) {
$logger = new VoidLogger();
// just add a stream in case it's either writable or not file
if (!is_file($stream) || is_writable($stream)) {
try {
- $logger = new StreamLogger($this->channel, $stream, $introspection, $loglevel);
+ $logger = new StreamLogger($this->channel, $stream, $introspection, $fileSystem, $loglevel);
} catch (\Throwable $t) {
// No logger ...
$logger = new VoidLogger();
*
* It should never get filled during normal usage of Friendica
*
- * @param Configuration $config The config
- * @param Profiler $profiler The profiler of the app
+ * @param IConfig $config The config
+ * @param Profiler $profiler The profiler of the app
+ * @param FileSystem $fileSystem FileSystem utils
*
* @return LoggerInterface The PSR-3 compliant logger instance
*
* @throws InternalServerErrorException
* @throws \Exception
*/
- public static function createDev(Configuration $config, Profiler $profiler)
+ public static function createDev(IConfig $config, Profiler $profiler, FileSystem $fileSystem)
{
$debugging = $config->get('system', 'debugging');
$stream = $config->get('system', 'dlogfile');
case 'stream':
default:
- $logger = new StreamLogger(self::DEV_CHANNEL, $stream, $introspection, LogLevel::DEBUG);
+ $logger = new StreamLogger(self::DEV_CHANNEL, $stream, $introspection, $fileSystem, LogLevel::DEBUG);
break;
}
case "3":
return LogLevel::INFO;
// legacy DATA
- case "5":
- // legacy ALL
case "4":
- return LogLevel::DEBUG;
+ // legacy ALL
+ case "5":
+ return LogLevel::DEBUG;
// default if nothing set
default:
return $level;