You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
483 B
23 lines
483 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace CodeHydrater;
|
|
|
|
bootstrap\registry::get('di')->register('log', function(array $arg) {
|
|
$file_name = null;
|
|
if (isset($arg[0]) && is_string($arg[0])) {
|
|
$file_name = $arg[0]; // filename
|
|
}
|
|
|
|
if (isset($arg[1]) && is_int($arg[1])) {
|
|
$count = $arg[1]; // max count
|
|
return new services\log($file_name, $count);
|
|
}
|
|
|
|
if (! empty($file_name)) {
|
|
return new services\log($file_name);
|
|
}
|
|
|
|
return new services\log();
|
|
}); |