本文整理汇总了PHP中Logger::notice方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::notice方法的具体用法?PHP Logger::notice怎么用?PHP Logger::notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::notice方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* {@inheritdoc}
*/
public function process($annotation, $context)
{
if ($annotation instanceof Info && $annotation->validate()) {
$root = $context->getRootContext();
if ($root->info !== null) {
Logger::notice('Overwriting ' . $annotation->identity() . ': "' . $root->info->_context . '" with "' . $annotation->_context . '"');
}
$root->info = $annotation;
}
}
示例2: helper
public function helper($name)
{
$path = SYS_PATH . DS . 'helpers' . DS . $name . '.helper.php';
if (!file_exists($path)) {
if (!file_exists($path)) {
return Logger::notice('Can\'t load helper ' . $name . '.helper.php');
}
$path = APP_PATH . DS . 'helpers' . DS . $name . '.helper.php';
}
include $path;
}
示例3: sanityCheck
/**
* Checks if data for this field is valid and removes broken dependencies
*
* @param Object_Abstract $object
* @return bool
*/
public function sanityCheck($object)
{
$key = $this->getName();
$sane = true;
try {
$this->checkValidity($object->{$key}, true);
} catch (Exception $e) {
Logger::notice("Detected insane relation, removing reference to non existent user with username [" . $object->{$key} . "]");
$object->{$key} = null;
$sane = false;
}
return $sane;
}
示例4: set
public function set($key, $obj, $expire = 0)
{
if (!$this->enabled) {
return false;
}
$success = $this->memcache->set($key, $obj, 0, $expire);
if ($success) {
Logger::info("Cache stored memcache key: {$key}");
} else {
Logger::notice("Cache failed to store memcache key: {$key}");
}
Cache::$sets[] = array('key' => $key, 'expire' => $expire, 'success' => $success);
return $success;
}
示例5: test_methods_Magento
public function test_methods_Magento()
{
$CONFIG_FILE_NAME = __DIR__ . '/logging_exception.yaml';
$LOGGER_NAME = 'defaultLoggerName';
/**
* Perform testing.
*/
$log = new Logger($CONFIG_FILE_NAME, $LOGGER_NAME);
$context = ['test' => true, 'env' => ['param1' => 'value1']];
$log->debug('debug', $context);
$log->info('info', $context);
$log->notice('notice', $context);
$log->warning('warning', $context);
$log->error('error', $context);
$log->alert('alert', $context);
$log->critical('critical', $context);
$log->emergency('emergency', $context);
}
示例6: logError
public static function logError($type, $msg, $file, $line)
{
$str = LogVars::$friendlyErrorType[$type] . ': ' . $msg . ' ' . $file . ':' . $line;
if (in_array($type, LogVars::$warnType)) {
Logger::warn('handle', $str);
} else {
if (in_array($type, LogVars::$errorType)) {
Logger::error('handle', $str);
Url::redirect404();
} else {
if (in_array($type, LogVars::$noticeType)) {
Logger::notice('handle', $str);
} else {
Logger::fatal('handle', $str);
Url::redirect404();
}
}
}
return true;
}
示例7: log
private static function log($type, $msg, $errorNo, $params)
{
if (class_exists('Xiaoju\\Beatles\\Utils\\Logger')) {
switch ($type) {
case 'debug':
Logger::debug($msg, $errorNo, $params);
break;
case 'trace':
Logger::trace($msg, $errorNo, $params);
break;
case 'notice':
Logger::notice($msg, $errorNo, $params);
break;
case 'warning':
Logger::warning($msg, $errorNo, $params);
break;
case 'fatal':
Logger::fatal($msg, $errorNo, $params);
break;
}
}
}
示例8: initialized
function initialized()
{
$ret = false;
if (is_writable($this->locations["tmp"])) {
if (!file_exists($this->locations["tmp"] . "/initialized.txt")) {
umask(02);
Logger::notice("App instance has not been initialized yet - doing so now");
if (extension_loaded("apc")) {
Logger::notice("Flushing APC cache");
apc_clear_cache();
}
// Create required directories for program execution
if (!file_exists($this->locations["tmp"] . "/compiled/")) {
mkdir($this->locations["tmp"] . "/compiled/", 02775);
}
$ret = touch($this->locations["tmp"] . "/initialized.txt");
} else {
$ret = true;
}
}
return $ret;
}
示例9: safeRedirect
/**
* Redirect, but only to a safe domain.
*
* @param string $Destination Where to redirect.
* @param int $StatusCode The status of the redirect. Defaults to 302.
*/
function safeRedirect($Destination = false, $StatusCode = null)
{
if (!$Destination) {
$Destination = Url('', true);
} else {
$Destination = Url($Destination, true);
}
$trustedDomains = TrustedDomains();
$isTrustedDomain = false;
foreach ($trustedDomains as $trustedDomain) {
if (urlMatch($trustedDomain, $Destination)) {
$isTrustedDomain = true;
break;
}
}
if ($isTrustedDomain) {
redirect($Destination, $StatusCode);
} else {
Logger::notice('Redirect to untrusted domain: {url}.', ['url' => $Destination]);
redirect(url("/home/leaving?Target=" . urlencode($Destination)));
}
}
示例10: notice
/**
* Normal but significant events.
*
* @param string $message
* @param array $context
*
* @return null
*/
public function notice($message, array $context = array())
{
\Logger::notice($message);
}
示例11: sendMailFromTemplate
/**
* @TODO comment this function
*/
protected function sendMailFromTemplate($recipients, $subject, $params, $templateFilename, $plaintext = true)
{
$fullTemplateFilename = dirname(__FILE__) . "/../templates/{$templateFilename}.txt";
Logger::debug("Template: {$fullTemplateFilename}");
$template = file_get_contents($fullTemplateFilename);
// @TODO Replace this with proper template stuff
$mailBody = $this->replaceTokens($template, $params);
if (true === $plaintext) {
$this->sendPlainTextMail($this->from, $recipients, $subject, $mailBody);
Logger::notice("Sent plaintext mail to [{$recipients}] with subject \"{$subject}\"");
} else {
$mailStatus = $this->sendHtmlMail($this->from, $recipients, $subject, $mailBody);
}
}
示例12: getLevelName
}
}
public function getLevelName($level)
{
return $this->logLevels[$level];
}
}
// testing
if (isset($_SERVER["argv"][1]) && $_SERVER["argv"][1] == "__main__") {
$logger = new Logger();
for ($i = 0; $i < 6; $i++) {
$logger->setLevel($i);
error_log("############## Level now: " . $i);
$logger->debug("");
$logger->info("");
$logger->notice("");
$logger->warn("");
$logger->error("");
$logger->critical("");
}
error_log("############# With Level Names");
for ($i = 0; $i < 6; $i++) {
$logger->setLevel($logger->getLevelName($i));
error_log("############## Level now: " . $logger->getLevelName($i));
$logger->debug("");
$logger->info("", __FILE__, __LINE__);
$logger->notice("");
$logger->warn("");
$logger->error("");
$logger->critical("");
}
示例13: catch
$prepayItem = $txn->getPrepayItem($oneType);
if (true === is_null($prepayItem)) {
//Logger::debug("No match for $oneType");
continue;
}
$templateFound = true;
$params['quantity'] = $prepayItem['quantity'];
$params['item_name'] = $prepayItem['item_name'];
$mail = SingletonFactory::getInstance()->getSingleton('MailManager');
if ("Completed" === $payment_status) {
try {
$status = $mail->sendConfirmationMailToUser($to, $params, $oneType);
} catch (Exception $e) {
kaput($e->getMessage());
}
Logger::notice("Sent confirmation mail (type={$oneType}) successfully to {$to}");
}
$params['payment_status'] = $payment_status;
try {
$mail->sendTransactionMailToAdmins($params);
} catch (Exception $e) {
kaput($e->getMessage());
}
Logger::debug("Sent notification mail to admins successfully, payment_status={$payment_status}");
}
if (false === $templateFound) {
Logger::error("Unable to find e-mail template");
}
} else {
Logger::debug("Mail disabled, not sending mail");
}
示例14: array
<?php
$userId = null;
$basic = new Uauth\Basic("Secured Area", array());
$basic->verify(function ($username, $password) use(&$userId) {
$select = PicDB::newSelect();
$select->cols(array("id"))->from("users")->where("username = :username")->where("password = :password")->bindValues(array("username" => $username, "password" => $password));
$id = PicDB::fetch($select, "value");
if ($id) {
$userId = (int) $id;
return true;
} else {
return false;
}
});
$basic->deny(function ($username) {
if ($username !== null) {
Logger::notice("main", "Failed login", array("username" => $username));
}
});
$basic->auth();
define("USERNAME", $basic->getUser());
define("USER_ID", $userId);
Logger::debug("main", "Successful authentication");
header("Content-Security-Policy: script-src 'self' https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com");
示例15: shutdownHandler
function shutdownHandler()
{
if ($this->debug && !empty($res)) {
$res = $this->timer->getResult();
$str[] = '[time:';
foreach ($res as $time) {
$str[] = ' ' . $time[0] . '=' . $time[1];
}
$str[] = ']';
Logger::notice(implode('', $str) . ' status=' . $this->status);
Logger::flush();
}
$this->_clearDbOrCache();
$this->_end();
}