本文整理汇总了PHP中Illuminate\Support\Facades\Log::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::debug方法的具体用法?PHP Log::debug怎么用?PHP Log::debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Log
的用法示例。
在下文中一共展示了Log::debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listenToUpload
/**
* Listen to Upload
*
* Observe Uploadable models for changes. Should be called from the boot() method.
* @return void
*/
protected function listenToUpload()
{
if (!($model = $this->getModelClass())) {
return;
}
if (Config::get('app.debug')) {
Log::debug('Binding upload relationship caches', ['uploadable' => $model]);
}
$flush_uploadable = function ($uploadable) {
$repository = $this->make($uploadable);
$tags = $repository->getTags('uploads');
if (Config::get('app.debug')) {
Log::debug('Flushing uploadable relationship caches', ['uploadable' => $repository->id, 'tags' => $tags]);
}
Cache::tags($tags)->flush();
};
$model::updated($flush_uploadable);
$model::deleted($flush_uploadable);
$flush_upload = function ($upload) use($model) {
$repository = Upload::make($upload);
$tags = $repository->getTags($model);
if (Config::get('app.debug')) {
Log::debug('Flushing upload relationship caches', ['model' => $model, 'tags' => $tags]);
}
Cache::tags($tags)->flush();
foreach ($this->withUpload($repository) as $uploadable) {
$uploadable->getModel()->touch();
}
};
$upload_model = Upload::getModelClass();
$upload_model::updated($flush_upload);
$upload_model::deleted($flush_upload);
}
示例2: boot
public function boot()
{
if (!($model = $this->getModelClass())) {
return;
}
parent::boot();
// Flush nested set caches related to the object
if (Config::get('app.debug')) {
Log::info('Binding heirarchical caches', ['model' => $model]);
}
// Trigger save events after move events
// Flushing parent caches directly causes an infinite recursion
$touch = function ($node) {
if (Config::get('app.debug')) {
Log::debug('Touching parents to trigger cache flushing.', ['parent' => $node->parent]);
}
// Force parent caches to flush
if ($node->parent) {
$node->parent->touch();
}
};
$model::moved($touch);
// Flush caches related to the ancestors
$flush = function ($node) {
$tags = $this->make($node)->getParentTags();
if (Config::get('app.debug')) {
Log::debug('Flushing parent caches', ['tags' => $tags]);
}
Cache::tags($tags)->flush();
};
$model::saved($flush);
$model::deleted($flush);
}
示例3: update
public function update(Request $request)
{
$request_attributes = $this->validateAndReturn($request, $this->getValidationRules());
Log::debug("\$request_attributes=" . json_encode($request_attributes, 192));
PlatformAdminMeta::setMulti($request_attributes);
return view('platformAdmin::xchain.settings.update', []);
}
示例4: logToConsole
public function logToConsole($tx_event)
{
if ($_debugLogTxTiming = Config::get('xchain.debugLogTxTiming')) {
PHP_Timer::start();
}
if (!isset($GLOBALS['XCHAIN_GLOBAL_COUNTER'])) {
$GLOBALS['XCHAIN_GLOBAL_COUNTER'] = 0;
}
$count = ++$GLOBALS['XCHAIN_GLOBAL_COUNTER'];
$xcp_data = $tx_event['counterpartyTx'];
if ($tx_event['network'] == 'counterparty') {
if ($xcp_data['type'] == 'send') {
$this->wlog("from: {$xcp_data['sources'][0]} to {$xcp_data['destinations'][0]}: {$xcp_data['quantity']} {$xcp_data['asset']} [{$tx_event['txid']}]");
} else {
$this->wlog("[" . date("Y-m-d H:i:s") . "] XCP TX FOUND: {$xcp_data['type']} at {$tx_event['txid']}");
}
} else {
if (rand(1, 100) === 1) {
$c = Carbon::createFromTimestampUTC(floor($tx_event['timestamp']))->timezone(new \DateTimeZone('America/Chicago'));
$this->wlog("heard {$count} tx. Last tx time: " . $c->format('Y-m-d h:i:s A T'));
}
}
if ($_debugLogTxTiming) {
Log::debug("[" . getmypid() . "] Time for logToConsole: " . PHP_Timer::secondsToTimeString(PHP_Timer::stop()));
}
}
示例5: _getPlaceInfo
private function _getPlaceInfo()
{
$place = Places::getPlaceName($this->lat, $this->lng, $this->name);
Log::debug($place);
$this->status = self::IDENTIFIED;
return $this;
}
示例6: fire
public function fire($job, $data)
{
// build the event data
$event_data = $this->event_builder->buildBlockEventData($data['hash']);
// fire an event
try {
Log::debug("Begin xchain.block.received {$event_data['height']} ({$event_data['hash']})");
Event::fire('xchain.block.received', [$event_data]);
Log::debug("End xchain.block.received {$event_data['height']} ({$event_data['hash']})");
// job successfully handled
$job->delete();
} catch (Exception $e) {
EventLog::logError('BTCBlockJob.failed', $e, $data);
// this block had a problem
// but it might be found if we try a few more times
$attempts = $job->attempts();
if ($attempts > self::MAX_ATTEMPTS) {
// we've already tried MAX_ATTEMPTS times - give up
Log::debug("Block {$data['hash']} event failed after attempt " . $attempts . ". Giving up.");
$job->delete();
} else {
$release_time = 2;
Log::debug("Block {$data['hash']} event failed after attempt " . $attempts . ". Trying again in " . self::RETRY_DELAY . " seconds.");
$job->release(self::RETRY_DELAY);
}
}
}
示例7: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
try {
$response = $next($request);
// always render exceptions ourselves
if (isset($response->exception) and $response->exception) {
throw $response->exception;
}
return $response;
} catch (HttpResponseException $e) {
// HttpResponseException can pass through
throw $e;
} catch (ValidationException $e) {
$validator = $e->validator;
$flat_errors = [];
foreach ($validator->errors()->getMessages() as $errors) {
$flat_errors = array_merge($flat_errors, array_values($errors));
}
$response = new JsonResponse(['message' => "The request was not processed successfully. " . implode(" ", $flat_errors), 'errors' => $flat_errors], 422);
return $response;
} catch (Exception $e) {
\Illuminate\Support\Facades\Log::debug("HandleAPIErrors caught " . get_class($e) . " " . $e->getMessage());
try {
$error_trace = $this->getExceptionTraceAsString($e);
} catch (Exception $other_e) {
$error_trace = "FAILED getExceptionTraceAsString: " . $other_e->getMessage() . "\n\n" . $e->getTraceAsString();
}
$this->event_log->logError('error.api.uncaught', $e, ['errorTrace' => $error_trace]);
// catch any uncaught exceptions
// and return a 500 response
$response = new JsonResponse(['message' => 'Unable to process this request', 'errors' => ['Unexpected error']], 500);
return $response;
}
}
示例8: getLogin
/**
* Store a newly created resource in storage.
* @Get("/{provider}/callback", as="social.login.getLogin")
* @param string $provider
* @return \Illuminate\Http\Response
*/
public function getLogin($provider)
{
$userData = Socialite::with($provider)->user();
Log::debug(print_r($userData, true));
$user = User::firstOrCreate(['username' => $userData->nickname, 'email' => $userData->email]);
Auth::login($user);
return response()->redirectToRoute('articles.getIndex');
}
示例9: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
Log::info('infoメッセージ');
Log::debug('debugメッセージ');
Log::warning('warningメッセージ');
Log::error('errorメッセージ');
return view('welcome');
}
示例10: getChannels
/**
* Get all available channels from config
*
* @return array
*/
public function getChannels()
{
$configChannels = config('bow.log.channels');
if (count($configChannels) <= 0) {
Log::debug('bow.log.channels is not configured');
}
return $configChannels;
}
示例11: __construct
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($jobResult, $userId, $userIpAddress)
{
//
$this->jobResult = $jobResult;
$this->userId = $userId;
$this->userIpAddress = $userIpAddress;
Log::debug('JobFinished Event fired');
}
示例12: getCssOutput
private function getCssOutput($tmpHtmlFile)
{
if ($this->cssfile[0] === '/') {
$this->cssfile = substr($this->cssfile, 1);
}
$cmd = $this->servicePath . ' ' . $tmpHtmlFile . ' -mc ' . $this->cssfile;
Log::debug('AsyncCss Exec: ' . $cmd);
return shell_exec($cmd);
}
示例13: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$response = $next($request);
$age = $request->input('age');
Log::debug('age -> ' . $age);
$rjb = $request->header('rjb', 'bar');
$response->headers->set('foo', $rjb);
return $response;
}
示例14: fire
public function fire($job, $data)
{
try {
$_debugLogTxTiming = Config::get('xchain.debugLogTxTiming');
// load from bitcoind
if ($_debugLogTxTiming) {
Log::debug("Begin {$data['txid']}");
}
if ($_debugLogTxTiming) {
PHP_Timer::start();
}
$transaction_model = $this->bitcoin_transaction_store->getParsedTransactionFromBitcoind($data['txid']);
$bitcoin_transaction_data = $transaction_model['parsed_tx']['bitcoinTx'];
if ($_debugLogTxTiming) {
Log::debug("[" . getmypid() . "] Time for getParsedTransactionFromBitcoind: " . PHP_Timer::secondsToTimeString(PHP_Timer::stop()));
}
// parse the transaction
if ($_debugLogTxTiming) {
PHP_Timer::start();
}
$event_data = $this->transaction_data_builder->buildParsedTransactionData($bitcoin_transaction_data, $data['ts']);
if ($_debugLogTxTiming) {
Log::debug("[" . getmypid() . "] Time for buildParsedTransactionData: " . PHP_Timer::secondsToTimeString(PHP_Timer::stop()));
}
// fire an event
if ($_debugLogTxTiming) {
PHP_Timer::start();
}
Event::fire('xchain.tx.received', [$event_data, 0, null, null]);
if ($_debugLogTxTiming) {
Log::debug("[" . getmypid() . "] Time for fire xchain.tx.received: " . PHP_Timer::secondsToTimeString(PHP_Timer::stop()));
}
// job successfully handled
if ($_debugLogTxTiming) {
PHP_Timer::start();
}
$job->delete();
if ($_debugLogTxTiming) {
Log::debug("[" . getmypid() . "] Time for job->delete(): " . PHP_Timer::secondsToTimeString(PHP_Timer::stop()));
}
} catch (Exception $e) {
EventLog::logError('BTCTransactionJob.failed', $e, $data);
// this transaction had a problem
// but it might be found if we try a few more times
$attempts = $job->attempts();
if ($attempts > self::MAX_ATTEMPTS) {
// we've already tried MAX_ATTEMPTS times - give up
Log::debug("Transaction {$data['txid']} event failed after attempt " . $attempts . ". Giving up.");
$job->delete();
} else {
$release_time = 2;
Log::debug("Transaction {$data['txid']} event failed after attempt " . $attempts . ". Trying again in " . self::RETRY_DELAY . " seconds.");
$job->release(self::RETRY_DELAY);
}
}
}
示例15: handle
public function handle()
{
$token = Seat::get('slack_token');
if ($token == null) {
throw new SlackSettingException("missing slack_token in settings");
}
// call rtm method in order to get a fresh new WSS uri
$api = new SlackApi($token);
$wss = $api->rtmStart();
// start a loop event which will handle RTM daemon
$loop = Factory::create();
$connector = new Connector($loop);
// prepare the event catcher (we only care about members join and channels)
$connector($wss)->then(function (WebSocket $conn) {
// trigger on RTM message event
$conn->on('message', function (MessageInterface $msg) use($conn) {
// since Slack RTM return json message, decode it first
$slackMessage = json_decode($msg, true);
// then, process to channel, groups and member case
switch ($slackMessage['type']) {
// if the event is of type "team_join", then update our Slack user table using the new slack user id
// common element between SeAT and Slack is mail address
case 'team_join':
$this->newMember($slackMessage['user']);
break;
// if the event is of type "channel_created"
// then update our Slack channel table using new slack channel id
// if the event is of type "channel_created"
// then update our Slack channel table using new slack channel id
case 'group_joined':
case 'channel_created':
$this->createChannel($slackMessage['channel']);
break;
// if the event is of type "channel_delete", then remove the record from our Slack channel table
// if the event is of type "channel_delete", then remove the record from our Slack channel table
case 'channel_deleted':
case 'group_archive':
SlackChannel::destroy($slackMessage['channel']);
break;
case 'group_unarchive':
Log::debug('[Slackbot][Daemon][group_unarchive] ' . print_r($slackMessage, true));
$this->restoreGroup($slackMessage['channel']);
break;
case 'channel_rename':
case 'group_rename':
$this->renameChannel($slackMessage['channel']);
break;
}
});
}, function (\Exception $e) use($loop) {
echo $e->getMessage();
$loop->stop();
});
$loop->run();
return;
}