Skip to content

Commit

Permalink
🔥 removed logger install
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Nov 9, 2021
1 parent 63c70e3 commit 0f04862
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,6 @@ class Log
const INFO = 7;
const DEBUG = 8;


/**
* Install logger in leaf app
*
* @param Leaf\App $app The leaf app insance (not needed in functional mode)
*/
public function install($app = null)
{
if (!$app && function_exists("app")) {
$app = app();
}

// Default log writer
$app->register("logWriter", function ($c) use ($app) {
$logWriter = Config::get("log.writer");

$file = $app->config("log.dir") . $app->config("log.file");

return is_object($logWriter) ? $logWriter : new \Leaf\LogWriter($file, $app->config("log.open") ?? true);
});

// Default log
$app->register("log", function ($c) use ($app) {
$log = new \Leaf\Log($c["logWriter"]);
$log->enabled($app->config("log.enabled"));
$log->level($app->config("log.level"));

return $log;
});
}

/**
* @var array
*/
Expand Down

0 comments on commit 0f04862

Please sign in to comment.