mirror of
https://github.com/friendica/friendica
synced 2025-03-03 22:28:25 +00:00
Replace Logger with DI::logger() in Object classes
This commit is contained in:
parent
0b20a9c923
commit
33b5ba35d4
2 changed files with 12 additions and 14 deletions
|
@ -11,7 +11,6 @@ use Friendica\Content\ContactSelector;
|
|||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
|
@ -782,10 +781,10 @@ class Post
|
|||
public function addChild(Post $item)
|
||||
{
|
||||
if (!$item->getId()) {
|
||||
Logger::error('Post object has no id', ['post' => $item]);
|
||||
DI::logger()->error('Post object has no id', ['post' => $item]);
|
||||
return false;
|
||||
} elseif ($this->getChild($item->getId())) {
|
||||
Logger::warning('Post object already exists', ['post' => $item]);
|
||||
DI::logger()->warning('Post object already exists', ['post' => $item]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -793,13 +792,13 @@ class Post
|
|||
* Only add what will be displayed
|
||||
*/
|
||||
if ($item->getDataValue('network') === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item->getDataValue('uid')) {
|
||||
Logger::warning('Post object does not belong to local user', ['post' => $item, 'local_user' => DI::userSession()->getLocalUserId()]);
|
||||
DI::logger()->warning('Post object does not belong to local user', ['post' => $item, 'local_user' => DI::userSession()->getLocalUserId()]);
|
||||
return false;
|
||||
} elseif (
|
||||
DI::activity()->match($item->getDataValue('verb'), Activity::LIKE) ||
|
||||
DI::activity()->match($item->getDataValue('verb'), Activity::DISLIKE)
|
||||
) {
|
||||
Logger::warning('Post objects is a like/dislike', ['post' => $item]);
|
||||
DI::logger()->warning('Post objects is a like/dislike', ['post' => $item]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -884,7 +883,7 @@ class Post
|
|||
}
|
||||
}
|
||||
|
||||
Logger::info('[WARN] Item::removeChild : Item is not a child (' . $id . ').');
|
||||
DI::logger()->info('[WARN] Item::removeChild : Item is not a child (' . $id . ').');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -947,7 +946,7 @@ class Post
|
|||
public function getDataValue(string $name)
|
||||
{
|
||||
if (!isset($this->data[$name])) {
|
||||
// Logger::info('[ERROR] Item::getDataValue : Item has no value name "'. $name .'".');
|
||||
// DI::logger()->info('[ERROR] Item::getDataValue : Item has no value name "'. $name .'".');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
namespace Friendica\Object;
|
||||
|
||||
use Friendica\Content\Conversation;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\DI;
|
||||
use Friendica\Protocol\Activity;
|
||||
|
@ -77,7 +76,7 @@ class Thread
|
|||
$this->writable = $writable;
|
||||
break;
|
||||
default:
|
||||
Logger::info('[ERROR] Conversation::setMode : Unhandled mode ('. $mode .').');
|
||||
DI::logger()->info('[ERROR] Conversation::setMode : Unhandled mode ('. $mode .').');
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
@ -138,12 +137,12 @@ class Thread
|
|||
$item_id = $item->getId();
|
||||
|
||||
if (!$item_id) {
|
||||
Logger::info('[ERROR] Conversation::addThread : Item has no ID!!');
|
||||
DI::logger()->info('[ERROR] Conversation::addThread : Item has no ID!!');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->getParent($item->getId())) {
|
||||
Logger::info('[WARN] Conversation::addThread : Thread already exists ('. $item->getId() .').');
|
||||
DI::logger()->info('[WARN] Conversation::addThread : Thread already exists ('. $item->getId() .').');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -151,12 +150,12 @@ class Thread
|
|||
* Only add will be displayed
|
||||
*/
|
||||
if ($item->getDataValue('network') === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item->getDataValue('uid')) {
|
||||
Logger::info('[WARN] Conversation::addThread : Thread is a mail ('. $item->getId() .').');
|
||||
DI::logger()->info('[WARN] Conversation::addThread : Thread is a mail ('. $item->getId() .').');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($item->getDataValue('verb') === Activity::LIKE || $item->getDataValue('verb') === Activity::DISLIKE) {
|
||||
Logger::info('[WARN] Conversation::addThread : Thread is a (dis)like ('. $item->getId() .').');
|
||||
DI::logger()->info('[WARN] Conversation::addThread : Thread is a (dis)like ('. $item->getId() .').');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -190,7 +189,7 @@ class Thread
|
|||
$item_data = $item->getTemplateData($conv_responses, $formSecurityToken);
|
||||
|
||||
if (!$item_data) {
|
||||
Logger::info('[ERROR] Conversation::getTemplateData : Failed to get item template data ('. $item->getId() .').');
|
||||
DI::logger()->info('[ERROR] Conversation::getTemplateData : Failed to get item template data ('. $item->getId() .').');
|
||||
return false;
|
||||
}
|
||||
$result[] = $item_data;
|
||||
|
|
Loading…
Add table
Reference in a new issue