Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.6] Rework Logging #22635

Merged
merged 17 commits into from
Jan 4, 2018
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 0 additions & 98 deletions src/Illuminate/Contracts/Logging/Log.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ public function registerCoreContainerAliases()
'filesystem.cloud' => [\Illuminate\Contracts\Filesystem\Cloud::class],
'hash' => [\Illuminate\Hashing\HashManager::class],
'translator' => [\Illuminate\Translation\Translator::class, \Illuminate\Contracts\Translation\Translator::class],
'log' => [\Illuminate\Log\Writer::class, \Illuminate\Contracts\Logging\Log::class, \Psr\Log\LoggerInterface::class],
'log' => [\Illuminate\Log\Logger::class, \Illuminate\Contracts\Logging\Log::class, \Psr\Log\LoggerInterface::class],
'mailer' => [\Illuminate\Mail\Mailer::class, \Illuminate\Contracts\Mail\Mailer::class, \Illuminate\Contracts\Mail\MailQueue::class],
'auth.password' => [\Illuminate\Auth\Passwords\PasswordBrokerManager::class, \Illuminate\Contracts\Auth\PasswordBrokerFactory::class],
'auth.password.broker' => [\Illuminate\Auth\Passwords\PasswordBroker::class, \Illuminate\Contracts\Auth\PasswordBroker::class],
Expand Down
15 changes: 14 additions & 1 deletion src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ function info($message, $context = [])
*
* @param string $message
* @param array $context
* @return \Illuminate\Contracts\Logging\Log|null
* @return \Illuminate\Log\LogManager|null
*/
function logger($message = null, array $context = [])
{
Expand All @@ -521,6 +521,19 @@ function logger($message = null, array $context = [])
}
}

if (! function_exists('logs')) {
/**
* Get a log driver instance.
*
* @param string $driver
* @return \Illuminate\Log\LogManager|\Psr\Log\LoggerInterface
*/
function logs($driver = null)
{
return $driver ? app('log')->driver($driver) : app('log');
}
}

if (! function_exists('method_field')) {
/**
* Generate a form field to spoof the HTTP verb used by forms.
Expand Down
Loading