本文整理汇总了PHP中Log::warn方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::warn方法的具体用法?PHP Log::warn怎么用?PHP Log::warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::warn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: scan
private final function scan($root_path, $dir)
{
if ($this->dump_scans) {
echo "Scanning : " . $dir . "<br />";
}
if (!is_dir($root_path . $dir)) {
Log::warn(__METHOD__, "La directory " . $root_path . $dir . " non e' una directory valida ... skip ...");
return;
}
//IMPORTANTE SCANDIR DEVE RITORNARE IN ORDINE ALFABETICO!!! Default = 0 -> OK
if (!array_key_exists($dir, self::$skip_dirs)) {
$file_list = scandir($root_path . $dir);
foreach ($file_list as $filename) {
if (!array_key_exists($filename, self::$skip_dirs)) {
//echo "Scanning : [ ".$filename." ]";
$full_path = $root_path . $dir . $filename;
if ($this->scan_recursively && $this->is_subdirectory($root_path . $dir, $filename)) {
$this->scan($root_path, $dir . $filename . DIRECTORY_SEPARATOR);
} else {
if (is_file($full_path) && $this->is_valid_filename($filename)) {
if ($this->dump_scans) {
echo "Valid file found : " . $dir . $filename . "<br />";
}
$this->valid_file_found($dir, $filename);
}
}
}
}
}
}
示例2: __setup_crawl__
/**
* Planet クロールする
**/
public static function __setup_crawl__()
{
$http_feed = new Feed();
foreach (C(PlanetSubscription)->find_all() as $subscription) {
Exceptions::clear();
Log::debug(sprintf('[crawl] feed: %d (%s)', $subscription->id(), $subscription->title()));
try {
$feed = $http_feed->do_read($subscription->rss_url());
$subscription->title($feed->title());
if ($feed->is_link()) {
$subscription->link(self::_get_link_href($feed->link()));
}
$subscription->rss_url($http_feed->url());
$subscription->save(true);
foreach ($feed->entry() as $entry) {
Exceptions::clear();
try {
$planet_entry = new PlanetEntry();
$planet_entry->subscription_id($subscription->id());
$planet_entry->title(Tag::cdata($entry->title()));
$planet_entry->description(Text::htmldecode(Tag::cdata($entry->fm_content())));
$planet_entry->link($entry->first_href());
$planet_entry->updated($entry->published());
$planet_entry->save();
} catch (Exception $e) {
Log::warn($e->getMessage());
}
}
} catch (Exception $e) {
Log::error($e);
}
}
}
示例3: myErrorHandler
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
if (!class_exists('Log')) {
require YYUC_LIB . 'sys/log.php';
}
$err_msg = "信息:{$errno}。内容:{$errstr},发生在文件{$errfile}的{$errline}行";
switch ($errno) {
case E_USER_ERROR:
Log::error($err_msg);
if (Conf::$is_developing) {
echo $err_msg;
}
exit(1);
break;
case E_USER_WARNING:
Log::warn($err_msg);
break;
case E_USER_NOTICE:
Log::info($err_msg);
break;
default:
Log::info($err_msg);
break;
}
return true;
}
示例4: set
/**
* @see \Components\Cache_Backend::set() set
*/
public function set($key_, $value_, $ttl_ = 86400)
{
if (false === @apc_store(COMPONENTS_CACHE_NAMESPACE . "-{$key_}", $value_, $ttl_)) {
Log::warn('components/cache/backend/apc', 'Unable to cache value [key: %s, value: %s].', $key_, $value_);
return false;
}
return true;
}
示例5: addToSession
/**
* bung this user's ID in the session
*/
public function addToSession()
{
$s = Session::getInstance();
$s->user_id = $this->getId();
if ($s->user_id === null) {
Log::warn("Adding null user ID to session");
}
$this->setAuthed(true);
}
示例6: LogAction
public function LogAction()
{
Log::fatal('something');
Log::warn('something');
Log::notice('something');
Log::debug('something');
Log::sql('something');
echo '请到Log文件夹查看效果。如果是SAE环境,可以在日志中心的DEBUG日志查看。';
}
示例7: removeInvalidBlock
/**
* Remove block marking as invalid
* @param Entity\Abstraction\Block $block
* @param string $reason
*/
public function removeInvalidBlock(Block $block, $reason = 'unknown')
{
/* @var $testBlock Entity\Abstraction\Block */
foreach ($this as $index => $testBlock) {
if ($testBlock->equals($block)) {
\Log::warn("Block {$block} removed as invalid with reason: {$reason}");
$this->offsetUnset($index);
}
}
}
示例8: edit
/**
* Update category entry in database
*/
public function edit()
{
if ($this->id > 0 && $this->warehouseId > 0 && is_string($this->name) && strlen($this->name) > 0) {
$sql = "UPDATE " . Database::getTableName('categories') . " SET parent=?, warehouse=?, name=?, demand=?, male=?, female=?, children=?, baby=?, summer=?, winter=?, weight=? WHERE id=?";
$response = Database::getInstance()->sql('editCategory', $sql, 'iisiiiiiiiii', [$this->parent, $this->warehouseId, $this->name, $this->demand, $this->male, $this->female, $this->children, $this->baby, $this->summer, $this->winter, $this->weight, $this->id], false);
if (is_array($response)) {
Log::debug('Edited category #' . $this->id);
return true;
}
} else {
Log::warn('Category id is #' . $this->id);
}
return false;
}
示例9: load
public function load($class_name)
{
$loaded = false;
if ($this->has_found_element($class_name)) {
$path = $this->get_element_path_by_name($class_name);
require_once $path;
if (array_key_exists(self::CLASS_AFTER_LOAD_INTERFACE, class_implements($class_name))) {
$eval_string = $class_name . "::" . self::CLASS_AFTER_LOAD_METHOD . "('{$class_name}');";
eval($eval_string);
Log::info(__METHOD__, "Class {$class_name} initialized after loading.");
}
$loaded = true;
return;
}
Log::warn(__METHOD__, "Classe non trovata : {$class_name}, using other classloaders ...");
}
示例10: send
/**
* Sends a http-query.
* @param string $url
* @param array $params
* @return null|Response
*/
public function send($url, array $params = [])
{
$params = array_merge(parse_url($url), $params);
$request = $this->getRequest($params);
try {
$response = $this->getResponse($url, $params);
} catch (BadResponseException $e) {
if ($e->hasResponse()) {
return $this->convertResponse($e->getResponse(), $request);
}
return null;
} catch (\Exception $e) {
if (class_exists('\\rock\\log\\Log')) {
Log::warn(BaseException::convertExceptionToString($e));
}
return null;
}
return $this->convertResponse($response, $request);
}
示例11: balance
/**
* example.com/api/<guid>/balance?password=xxx&debug=1
*/
public function balance($guid)
{
if (!$this->attemptAuth()) {
return Response::json(['error' => AUTHENTICATION_FAIL]);
}
if (Input::get('cryptotype')) {
$this->crypto_type_id = Input::get('cryptotype');
}
// at this point '$this->user' is already set
$user_balance = Balance::getBalance($this->user->id, $this->crypto_type_id);
if (count($user_balance)) {
Log::info('Queried balance for ' . $this->user->email . ': ' . $user_balance->balance . ' satoshis. Crypto type id: ' . $this->crypto_type_id);
$response = ['balance' => $user_balance->balance, 'crypto_type' => $this->crypto_type_id];
} else {
Log::warn('Balance not found for user ' . $this->user->email . 'for crypto type ' . $this->crypto_type_id);
$response = ['error' => 'Balance not found for crypto type ' . $this->crypto_type_id];
}
return Response::json($response);
}
示例12: dump
/**
* Send data back to YAML
*
* @param array $array Array of data to convert
* @param string $mode Mode to parse (loose|transitional|strict)
* @return string
*/
public static function dump($array, $mode = null)
{
$mode = $mode ? $mode : self::getMode();
switch ($mode) {
case 'loose':
return Spyc::YAMLDump($array);
case 'strict':
return sYaml::dump($array, 5, 2);
case 'transitional':
try {
return sYaml::dump($array, 5, 2);
} catch (Exception $e) {
Log::warn($e->getMessage() . ' Falling back to loose mode.', 'core', 'YAML');
return Spyc::YAMLDump($array);
}
default:
return Spyc::YAMLDump($array);
}
}
示例13: load_from_dir
public static function load_from_dir($dir)
{
if ($dir instanceof Dir) {
$my_dir = $dir;
} else {
$my_dir = new Dir($dir);
}
self::$css_dirs[] = $my_dir;
//CSS_DIRS
if ($my_dir->exists() && $my_dir->isDir()) {
$file_list = $my_dir->listFiles();
foreach ($file_list as $f) {
if ($f->isFile() && $f->getExtension() == "css") {
self::require_css_file($f);
}
}
} else {
Log::warn("load_from_dir", "Impossibile caricare i css dalla directory : " . $my_dir->getName());
}
}
示例14: edit
/**
* Update carton entry in database
*/
public function edit()
{
if ($this->id > 0 && $this->warehouseId > 0) {
if ($this->paletteId != null && $this->paletteId > 0) {
$palette = new Palette($this->paletteId, $this->warehouseId);
if ($palette) {
$this->locationId = $palette->locationId;
}
}
$sql = "UPDATE " . Database::getTableName('cartons') . " SET warehouse=?, location=?, palette=? WHERE id=?";
$response = Database::getInstance()->sql('editCarton', $sql, 'iiii', [$this->warehouseId, $this->locationId, $this->paletteId, $this->id], false);
if (is_array($response)) {
Log::debug('Edited carton #' . $this->id);
return true;
} else {
Log::warn('carton id is #' . $this->id);
}
}
return false;
}
示例15: setUp
public static function setUp($logSettings)
{
Log::$err = $logSettings['errors'];
Log::$warn = $logSettings['warnings'];
Log::$all = $logSettings['all'];
Log::$debug = $logSettings['debug'];
Log::$req = $logSettings['requests'];
//removing old files
if (file_exists(Log::$err)) {
unlink(Log::$err);
}
if (file_exists(Log::$warn)) {
unlink(Log::$warn);
}
if (file_exists(Log::$all)) {
unlink(Log::$all);
}
if (file_exists(Log::$debug)) {
unlink(Log::$debug);
}
if (file_exists(Log::$req)) {
unlink(Log::$req);
}
}