本文整理汇总了PHP中Illuminate\Support\Facades\Log::warning方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::warning方法的具体用法?PHP Log::warning怎么用?PHP Log::warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Log
的用法示例。
在下文中一共展示了Log::warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
public function parse()
{
if (is_null($this->rawData) === true || count(explode("\n", $this->rawData)) < 3) {
$whoisServer = isset($this->rir->whois_server) ? $this->rir->whois_server : 'NO WHOIS SERVER';
Log::warning("No raw whois data returned for: " . $this->input . "(" . $whoisServer . ")");
return null;
}
// Check if there is the unallocated words in whois returned data
if (strpos($this->rawData, 'Unallocated and unassigned') !== false) {
Log::warning("Unassigned/Unallocated prefix on: " . $this->input . "(" . $this->rir->whois_server . ")");
return null;
}
// Check if there the usual issues with the 'high volume' error
if (strpos($this->rawData, 'Unable to service request due to high volume') !== false) {
Log::warning("High volume whois server error on: " . $this->input . "(" . $this->rir->whois_server . ")");
return null;
}
$functionName = strtolower($this->rir->name) . "Execute";
try {
$results = $this->{$functionName}();
} catch (\Exception $e) {
Log::warning(["Something went wrong on: " . $this->input . "(" . $this->rir->whois_server . ")"], [$e->getMessage()]);
return null;
}
return $results;
}
示例2: send
/**
* {@inheritdoc}
*/
public function send(Swift_Mime_Message $message, &$failedRecipients = null)
{
try {
$to = implode(', ', array_keys((array) $message->getTo()));
$cc = implode(', ', array_keys((array) $message->getCc()));
$bcc = implode(', ', array_keys((array) $message->getBcc()));
$replyto = '';
foreach ((array) $message->getReplyTo() as $address => $name) {
$replyto = $address;
break;
}
$mail_options = ["sender" => "admin@{$this->app->getGaeAppId()}.appspotmail.com", "to" => $to, "subject" => $message->getSubject(), "htmlBody" => $message->getBody()];
if ($cc !== '') {
$mail_options['cc'] = $cc;
}
if ($bcc !== '') {
$mail_options['bcc'] = $bcc;
}
if ($replyto !== '') {
$mail_options['replyto'] = $replyto;
}
$attachments = $this->getAttachmentsArray($message);
if (count($attachments) > 0) {
$mail_options['attachments'] = $attachments;
}
$gae_message = new GAEMessage($mail_options);
$gae_message->send();
} catch (InvalidArgumentException $ex) {
Log::warning("Exception sending mail: " . $ex);
}
}
示例3: getUserFromCookie
public function getUserFromCookie($cookie)
{
$tokenObject = new Token($cookie);
// Get a payload info from the token
try {
$payload = JWTAuth::decode($tokenObject);
} catch (TokenExpiredException $e) {
$message = 'Token in cookie was expired';
throw new TokenInCookieExpiredException($message, null, $e);
}
// Get user by the payload info
try {
$user = $this->userUpdater->updateBaseInfo($payload);
} catch (RepositoryException $e) {
throw new AuthException($e->getMessage(), null, $e);
}
// Attempt to update his profile by API or just log the error
try {
$user = $this->userUpdater->updateAdditionalInfo($cookie, $user);
} catch (UpdatingFailureException $e) {
Log::warning('An additional user information was\'nt updated. ' . $e->getMessage());
}
// Login
Auth::login($user, true);
// Return an actual user model if login passes
if (Auth::check()) {
return $this->userRepository->findWithRelations(Auth::id(), ['localRole']);
} else {
throw new AuthException('Login error. User is not authorized.');
}
}
示例4: getOrder
/**
* Listens for and stores PayPal IPN requests.
*
* @throws InvalidIpnException
*
* @return IpnOrder
*/
public function getOrder()
{
$ipnMessage = null;
$listenerBuilder = new ListenerBuilder();
if ($this->getEnvironment() == 'sandbox') {
$listenerBuilder->useSandbox();
// use PayPal sandbox
}
$listener = $listenerBuilder->build();
$listener->onVerified(function (MessageVerifiedEvent $event) {
$ipnMessage = $event->getMessage();
Log::info('IPN message verified - ' . $ipnMessage);
$this->order = $this->store($ipnMessage);
});
$listener->onInvalid(function (MessageInvalidEvent $event) {
$report = $event->getMessage();
Log::warning('Paypal returned invalid for ' . $report);
});
$listener->onVerificationFailure(function (MessageVerificationFailureEvent $event) {
$error = $event->getError();
// Something bad happend when trying to communicate with PayPal!
Log::error('Paypal verification error - ' . $error);
});
$listener->listen();
return $this->order;
}
示例5: detectAllLocation
public static function detectAllLocation()
{
$views = View::all();
foreach ($views as $view) {
if ($view->location != "") {
continue;
}
$ip = $view->ip;
$client = new Client(['base_uri' => 'http://ip.taobao.com', 'timeout' => 5.0]);
try {
$response = $client->request('GET', '/service/getIpInfo.php', ['query' => "ip={$ip}"]);
$body = json_decode($response->getBody());
if ($body->code == 0) {
$country = $body->data->country;
$area = $body->data->area;
$region = $body->data->region;
$city = $body->data->city;
$isp = $body->data->isp;
$location = "{$country}-{$area}-{$region}-{$city}-{$isp}";
} else {
$location = "获取失败";
}
$view->location = $location;
} catch (\Exception $e) {
Log::warning($e->getMessage());
}
$view->save();
}
}
示例6: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
if ($e instanceof ParserException) {
Log::warning('Hiba az url betöltésekor');
return;
}
return parent::report($e);
}
示例7: 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');
}
示例8: completed
public function completed()
{
if (count($this->answered()) == count($this->answers)) {
$this->completed = true;
} else {
Log::warning('Попытка завершить тест при не всех отвеченных вопросах');
}
return $this;
}
示例9: getPermission
/**
* Returns an empty error in case of non-existend database (i.e. when working with a newly deployed system).
*
* @return array|\Illuminate\Database\Eloquent\Collection|static[]
*/
protected function getPermission()
{
try {
return Permission::with('roles')->get();
} catch (PDOException $e) {
Log::warning('Permission table could not be found when trying to load permissions in AuthServiceProvider');
return [];
}
}
示例10: checkFail
public function checkFail($check_id, $note = null)
{
try {
$this->guzzle_client->get($this->consul_url . '/v1/agent/check/fail/' . urlencode($check_id), ['query' => ['note' => $note]]);
return true;
} catch (Exception $e) {
Log::warning("failed to update check failure: " . $check_id);
return false;
}
}
示例11: getGametype
/**
* @param $id
* @return string
*/
public static function getGametype($id)
{
$id = intval($id);
if (isset(self::$gametype_ids[$id])) {
return self::$gametype_ids[$id];
} else {
Log::warning('Unknown gametype id ' . $id);
return 'Unknown';
}
}
示例12: teamIdToString
/**
* @param $id
* @return string
*/
public static function teamIdToString($id)
{
$id = intval($id);
if (isset(self::$team_id_to_string[$id])) {
return self::$team_id_to_string[$id];
} else {
Log::warning('Team ID: ' . $id . ' is unknown.');
return 'Unknown';
}
}
示例13: insertValue
public function insertValue($value)
{
$now = Carbon::now();
try {
DB::table('chart_values')->insert(['chart_id' => $this->id, 'timestamp' => $now, 'value' => $value]);
} catch (Exception $error) {
Log::warning($error);
return false;
}
return true;
}
示例14: write
/**
* 写入一行数据到目标资源
*
* @param $row
* @return mixed
*/
public function write($row)
{
// 换行处理
$ret = [];
foreach ($row as $item) {
$ret[] = str_replace("\n", "\r", $item);
}
$ret = fputcsv($this->fd, $ret, "\t");
if (false === $ret) {
Log::warning("数据行写入csv发生错误,该行数据未能成功写入:" . json_encode($ret));
}
}
示例15: setBodyClass
public function setBodyClass(Request $request)
{
//$inputs = serialize($request->all());
//Log::info('Ajax request fired to setToggleMenu method: '.$inputs);
if ($request->has('styling')) {
//Log::info('Found hidemenu with value of: '.$request->input('hidemenu'));
session(['body-class' => $request->input('styling')]);
//Log::info('Session value is now: '.Session::get('hidden-menu'));
} else {
Log::warning('setBodyClass called with no styling input');
}
}