A Sample PHP Project for the tts_framework.
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.
 
 
 

21 lines
473 B

<?php
declare(strict_types=1);
\main_tts\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 \tts\services\log($file_name, $count);
}
if (! empty($file_name)) {
return new \tts\services\log($file_name);
}
return new \tts\services\log();
});