Files
shipping-portal/app/Classes/General/LogHelper.php
T

29 lines
653 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Classes\General;
use Illuminate\Support\Facades\Log;
class LogHelper
{
protected static $channelName;
public static function channel($channelName)
{
self::$channelName = $channelName;
return new self;
}
public static function info($message)
{
$channelName = self::$channelName;
Log::info("LogHelper message: {$message} channelName {$channelName}");
if(env('LARAVEL_VAPOR_ENABLED')){
Log::channel(self::$channelName.'_vapor')->info($message);
}
else{
Log::channel(self::$channelName)->info($message);
}
}
}