Browse Source

Logger Levels

update logger levels in calls
pull/6046/head
Adam Magness 3 years ago
parent
commit
50da89d861
  1. 12
      bin/daemon.php
  2. 58
      include/api.php
  3. 2
      include/conversation.php
  4. 10
      include/enotify.php
  5. 12
      include/items.php
  6. 2
      mod/acl.php
  7. 16
      mod/admin.php
  8. 6
      mod/dfrn_confirm.php
  9. 20
      mod/dfrn_notify.php
  10. 12
      mod/dfrn_poll.php
  11. 2
      mod/dfrn_request.php
  12. 2
      mod/display.php
  13. 2
      mod/events.php
  14. 8
      mod/item.php
  15. 10
      mod/nodeinfo.php
  16. 2
      mod/openid.php
  17. 16
      mod/photos.php
  18. 10
      mod/poco.php
  19. 2
      mod/poke.php
  20. 2
      mod/profile.php
  21. 4
      mod/pubsub.php
  22. 14
      mod/receive.php
  23. 8
      mod/redir.php
  24. 4
      mod/salmon.php
  25. 8
      mod/search.php
  26. 2
      mod/statistics_json.php
  27. 10
      mod/wall_upload.php
  28. 22
      src/App.php
  29. 4
      src/BaseModule.php
  30. 14
      src/Content/Text/BBCode.php
  31. 4
      src/Core/Authentication.php
  32. 4
      src/Core/Cache/MemcachedCacheDriver.php
  33. 2
      src/Core/NotificationsManager.php
  34. 2
      src/Core/Session/CacheSessionHandler.php
  35. 2
      src/Core/Session/DatabaseSessionHandler.php
  36. 18
      src/Core/UserImport.php
  37. 64
      src/Core/Worker.php
  38. 6
      src/Database/DBA.php
  39. 6
      src/Database/DBStructure.php
  40. 34
      src/Database/PostUpdate.php
  41. 2
      src/Model/APContact.php
  42. 4
      src/Model/Contact.php
  43. 4
      src/Model/Conversation.php
  44. 2
      src/Model/Event.php
  45. 24
      src/Model/GContact.php
  46. 76
      src/Model/Item.php
  47. 18
      src/Model/Profile.php
  48. 10
      src/Model/PushSubscriber.php
  49. 2
      src/Model/User.php
  50. 8
      src/Module/Magic.php
  51. 8
      src/Module/Owa.php
  52. 6
      src/Network/CurlResult.php
  53. 2
      src/Network/FKOAuth1.php
  54. 44
      src/Network/Probe.php
  55. 18
      src/Object/Image.php
  56. 10
      src/Object/Post.php
  57. 12
      src/Object/Thread.php
  58. 30
      src/Protocol/ActivityPub/Processor.php
  59. 64
      src/Protocol/ActivityPub/Receiver.php
  60. 14
      src/Protocol/ActivityPub/Transmitter.php
  61. 80
      src/Protocol/DFRN.php
  62. 140
      src/Protocol/Diaspora.php
  63. 6
      src/Protocol/Email.php
  64. 12
      src/Protocol/Feed.php
  65. 68
      src/Protocol/OStatus.php
  66. 66
      src/Protocol/PortableContact.php
  67. 4
      src/Util/Emailer.php
  68. 6
      src/Util/HTTPSignature.php
  69. 4
      src/Util/JsonLD.php
  70. 10
      src/Util/Network.php
  71. 6
      src/Util/ParseUrl.php
  72. 8
      src/Util/XML.php
  73. 2
      src/Worker/APDelivery.php
  74. 4
      src/Worker/CheckVersion.php
  75. 10
      src/Worker/CronJobs.php
  76. 6
      src/Worker/Delivery.php
  77. 2
      src/Worker/Directory.php
  78. 20
      src/Worker/DiscoverPoCo.php
  79. 22
      src/Worker/Expire.php
  80. 6
      src/Worker/GProbe.php
  81. 34
      src/Worker/Notifier.php
  82. 24
      src/Worker/OnePoll.php
  83. 2
      src/Worker/ProfileUpdate.php
  84. 4
      src/Worker/PubSubPublish.php
  85. 2
      src/Worker/SpoolPost.php
  86. 2
      view/theme/vier/style.php

12
bin/daemon.php

@ -98,7 +98,7 @@ if ($mode == "stop") {
unlink($pidfile);
Logger::log("Worker daemon process $pid was killed.", LOGGER_DEBUG);
Logger::log("Worker daemon process $pid was killed.", Logger::DEBUG);
Config::set('system', 'worker_daemon_mode', false);
die("Worker daemon process $pid was killed.\n");
@ -108,7 +108,7 @@ if (!empty($pid) && posix_kill($pid, 0)) {
die("Daemon process $pid is already running.\n");
}
Logger::log('Starting worker daemon.', LOGGER_DEBUG);
Logger::log('Starting worker daemon.', Logger::DEBUG);
if (!$foreground) {
echo "Starting worker daemon.\n";
@ -156,7 +156,7 @@ $last_cron = 0;
// Now running as a daemon.
while (true) {
if (!$do_cron && ($last_cron + $wait_interval) < time()) {
Logger::log('Forcing cron worker call.', LOGGER_DEBUG);
Logger::log('Forcing cron worker call.', Logger::DEBUG);
$do_cron = true;
}
@ -170,7 +170,7 @@ while (true) {
$last_cron = time();
}
Logger::log("Sleeping", LOGGER_DEBUG);
Logger::log("Sleeping", Logger::DEBUG);
$start = time();
do {
$seconds = (time() - $start);
@ -187,10 +187,10 @@ while (true) {
if ($timeout) {
$do_cron = true;
Logger::log("Woke up after $wait_interval seconds.", LOGGER_DEBUG);
Logger::log("Woke up after $wait_interval seconds.", Logger::DEBUG);
} else {
$do_cron = false;
Logger::log("Worker jobs are calling to be forked.", LOGGER_DEBUG);
Logger::log("Worker jobs are calling to be forked.", Logger::DEBUG);
}
}

58
include/api.php

@ -97,9 +97,9 @@ function api_source()
return "Twidere";
}
Logger::log("Unrecognized user-agent ".$_SERVER['HTTP_USER_AGENT'], LOGGER_DEBUG);
Logger::log("Unrecognized user-agent ".$_SERVER['HTTP_USER_AGENT'], Logger::DEBUG);
} else {
Logger::log("Empty user-agent", LOGGER_DEBUG);
Logger::log("Empty user-agent", Logger::DEBUG);
}
return "api";
@ -195,7 +195,7 @@ function api_login(App $a)
}
if (!x($_SERVER, 'PHP_AUTH_USER')) {
Logger::log('API_login: ' . print_r($_SERVER, true), LOGGER_DEBUG);
Logger::log('API_login: ' . print_r($_SERVER, true), Logger::DEBUG);
header('WWW-Authenticate: Basic realm="Friendica"');
throw new UnauthorizedException("This API requires login");
}
@ -236,7 +236,7 @@ function api_login(App $a)
}
if (!DBA::isResult($record)) {
Logger::log('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
Logger::log('API_login failure: ' . print_r($_SERVER, true), Logger::DEBUG);
header('WWW-Authenticate: Basic realm="Friendica"');
//header('HTTP/1.0 401 Unauthorized');
//die('This api requires login');
@ -315,7 +315,7 @@ function api_call(App $a)
$stamp = microtime(true);
$return = call_user_func($info['func'], $type);
$duration = (float) (microtime(true) - $stamp);
Logger::log("API call duration: " . round($duration, 2) . "\t" . $a->query_string, LOGGER_DEBUG);
Logger::log("API call duration: " . round($duration, 2) . "\t" . $a->query_string, Logger::DEBUG);
if (Config::get("system", "profiler")) {
$duration = microtime(true)-$a->performance["start"];
@ -335,7 +335,7 @@ function api_call(App $a)
+ $a->performance["network"] + $a->performance["file"]), 2),
round($duration, 2)
),
LOGGER_DEBUG
Logger::DEBUG
);
if (Config::get("rendertime", "callstack")) {
@ -376,7 +376,7 @@ function api_call(App $a)
$o .= $func . ": " . $time . "\n";
}
}
Logger::log($o, LOGGER_DEBUG);
Logger::log($o, Logger::DEBUG);
}
}
@ -522,7 +522,7 @@ function api_get_user(App $a, $contact_id = null)
$extra_query = "";
$url = "";
Logger::log("api_get_user: Fetching user data for user ".$contact_id, LOGGER_DEBUG);
Logger::log("api_get_user: Fetching user data for user ".$contact_id, Logger::DEBUG);
// Searching for contact URL
if (!is_null($contact_id) && (intval($contact_id) == 0)) {
@ -606,7 +606,7 @@ function api_get_user(App $a, $contact_id = null)
}
}
Logger::log("api_get_user: user ".$user, LOGGER_DEBUG);
Logger::log("api_get_user: user ".$user, Logger::DEBUG);
if (!$user) {
if (api_user() === false) {
@ -1136,7 +1136,7 @@ function api_statuses_update($type)
$posts_day = DBA::count('thread', $condition);
if ($posts_day > $throttle_day) {
Logger::log('Daily posting limit reached for user '.api_user(), LOGGER_DEBUG);
Logger::log('Daily posting limit reached for user '.api_user(), Logger::DEBUG);
// die(api_error($type, L10n::t("Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
throw new TooManyRequestsException(L10n::tt("Daily posting limit of %d post reached. The post was rejected.", "Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
}
@ -1150,7 +1150,7 @@ function api_statuses_update($type)
$posts_week = DBA::count('thread', $condition);
if ($posts_week > $throttle_week) {
Logger::log('Weekly posting limit reached for user '.api_user(), LOGGER_DEBUG);
Logger::log('Weekly posting limit reached for user '.api_user(), Logger::DEBUG);
// die(api_error($type, L10n::t("Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week)));
throw new TooManyRequestsException(L10n::tt("Weekly posting limit of %d post reached. The post was rejected.", "Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week));
}
@ -1164,7 +1164,7 @@ function api_statuses_update($type)
$posts_month = DBA::count('thread', $condition);
if ($posts_month > $throttle_month) {
Logger::log('Monthly posting limit reached for user '.api_user(), LOGGER_DEBUG);
Logger::log('Monthly posting limit reached for user '.api_user(), Logger::DEBUG);
// die(api_error($type, L10n::t("Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
throw new TooManyRequestsException(L10n::t("Monthly posting limit of %d post reached. The post was rejected.", "Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
}
@ -1249,7 +1249,7 @@ function api_media_upload()
"h" => $media["height"],
"image_type" => $media["type"]];
Logger::log("Media uploaded: " . print_r($returndata, true), LOGGER_DEBUG);
Logger::log("Media uploaded: " . print_r($returndata, true), Logger::DEBUG);
return ["media" => $returndata];
}
@ -1269,7 +1269,7 @@ function api_status_show($type, $item_id = 0)
$user_info = api_get_user($a);
Logger::log('api_status_show: user_info: '.print_r($user_info, true), LOGGER_DEBUG);
Logger::log('api_status_show: user_info: '.print_r($user_info, true), Logger::DEBUG);
if ($type == "raw") {
$privacy_sql = "AND NOT `private`";
@ -1345,7 +1345,7 @@ function api_status_show($type, $item_id = 0)
unset($status_info["user"]["uid"]);
unset($status_info["user"]["self"]);
Logger::log('status_info: '.print_r($status_info, true), LOGGER_DEBUG);
Logger::log('status_info: '.print_r($status_info, true), Logger::DEBUG);
if ($type == "raw") {
return $status_info;
@ -2142,7 +2142,7 @@ function api_statuses_user_timeline($type)
"api_statuses_user_timeline: api_user: ". api_user() .
"\nuser_info: ".print_r($user_info, true) .
"\n_REQUEST: ".print_r($_REQUEST, true),
LOGGER_DEBUG
Logger::DEBUG
);
$since_id = x($_REQUEST, 'since_id') ? $_REQUEST['since_id'] : 0;
@ -3650,7 +3650,7 @@ function api_friendships_destroy($type)
$contact_id = defaults($_REQUEST, 'user_id');
if (empty($contact_id)) {
Logger::log("No user_id specified", LOGGER_DEBUG);
Logger::log("No user_id specified", Logger::DEBUG);
throw new BadRequestException("no user_id specified");
}
@ -3658,7 +3658,7 @@ function api_friendships_destroy($type)
$contact = DBA::selectFirst('contact', ['url'], ['id' => $contact_id, 'uid' => 0, 'self' => false]);
if(!DBA::isResult($contact)) {
Logger::log("No contact found for ID" . $contact_id, LOGGER_DEBUG);
Logger::log("No contact found for ID" . $contact_id, Logger::DEBUG);
throw new NotFoundException("no contact found to given ID");
}
@ -3670,12 +3670,12 @@ function api_friendships_destroy($type)
$contact = DBA::selectFirst('contact', [], $condition);
if (!DBA::isResult($contact)) {
Logger::log("Not following Contact", LOGGER_DEBUG);
Logger::log("Not following Contact", Logger::DEBUG);
throw new NotFoundException("Not following Contact");
}
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
Logger::log("Not supported", LOGGER_DEBUG);
Logger::log("Not supported", Logger::DEBUG);
throw new ExpectationFailedException("Not supported");
}
@ -3686,7 +3686,7 @@ function api_friendships_destroy($type)
Contact::terminateFriendship($owner, $contact, $dissolve);
}
else {
Logger::log("No owner found", LOGGER_DEBUG);
Logger::log("No owner found", Logger::DEBUG);
throw new NotFoundException("Error Processing Request");
}
@ -4489,7 +4489,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
Logger::log(
"File upload src: " . $src . " - filename: " . $filename .
" - size: " . $filesize . " - type: " . $filetype,
LOGGER_DEBUG
Logger::DEBUG
);
// check if there was a php upload error
@ -4521,7 +4521,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
}
if ($max_length > 0) {
$Image->scaleDown($max_length);
Logger::log("File upload: Scaling picture to new size " . $max_length, LOGGER_DEBUG);
Logger::log("File upload: Scaling picture to new size " . $max_length, Logger::DEBUG);
}
$width = $Image->getWidth();
$height = $Image->getHeight();
@ -4531,7 +4531,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
if ($mediatype == "photo") {
// upload normal image (scales 0, 1, 2)
Logger::log("photo upload: starting new photo upload", LOGGER_DEBUG);
Logger::log("photo upload: starting new photo upload", Logger::DEBUG);
$r = Photo::store($Image, local_user(), $visitor, $hash, $filename, $album, 0, 0, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
if (!$r) {
@ -4552,10 +4552,10 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
Logger::log("photo upload: image upload with scale 2 (320x320) failed");
}
}
Logger::log("photo upload: new photo upload ended", LOGGER_DEBUG);
Logger::log("photo upload: new photo upload ended", Logger::DEBUG);
} elseif ($mediatype == "profileimage") {
// upload profile image (scales 4, 5, 6)
Logger::log("photo upload: starting new profile image upload", LOGGER_DEBUG);
Logger::log("photo upload: starting new profile image upload", Logger::DEBUG);
if ($width > 300 || $height > 300) {
$Image->scaleDown(300);
@ -4581,7 +4581,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
}
}
$Image->__destruct();
Logger::log("photo upload: new profile image upload ended", LOGGER_DEBUG);
Logger::log("photo upload: new profile image upload ended", Logger::DEBUG);
}
if (isset($r) && $r) {
@ -4808,7 +4808,7 @@ function api_friendica_remoteauth()
'sec' => $sec, 'expire' => time() + 45];
DBA::insert('profile_check', $fields);
Logger::log($contact['name'] . ' ' . $sec, LOGGER_DEBUG);
Logger::log($contact['name'] . ' ' . $sec, Logger::DEBUG);
$dest = ($url ? '&destination_url=' . $url : '');
System::externalRedirect(
@ -5056,7 +5056,7 @@ function api_in_reply_to($item)
// https://github.com/friendica/friendica/issues/1010
// This is a bugfix for that.
if (intval($in_reply_to['status_id']) == intval($item['id'])) {
Logger::log('this message should never appear: id: '.$item['id'].' similar to reply-to: '.$in_reply_to['status_id'], LOGGER_DEBUG);
Logger::log('this message should never appear: id: '.$item['id'].' similar to reply-to: '.$in_reply_to['status_id'], Logger::DEBUG);
$in_reply_to['status_id'] = null;
$in_reply_to['user_id'] = null;
$in_reply_to['status_id_str'] = null;

2
include/conversation.php

@ -752,7 +752,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
$threads = $conv->getTemplateData($conv_responses);
if (!$threads) {
Logger::log('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
Logger::log('[ERROR] conversation : Failed to get template data.', Logger::DEBUG);
$threads = [];
}
}

10
include/enotify.php

@ -134,7 +134,7 @@ function notification($params)
if ($params['type'] == NOTIFY_COMMENT) {
$thread = Item::selectFirstThreadForUser($params['uid'] ,['ignored'], ['iid' => $parent_id]);
if (DBA::isResult($thread) && $thread["ignored"]) {
Logger::log("Thread ".$parent_id." will be ignored", LOGGER_DEBUG);
Logger::log("Thread ".$parent_id." will be ignored", Logger::DEBUG);
L10n::popLang();
return;
}
@ -453,7 +453,7 @@ function notification($params)
$itemlink = $h['itemlink'];
if ($show_in_notification_page) {
Logger::log("adding notification entry", LOGGER_DEBUG);
Logger::log("adding notification entry", Logger::DEBUG);
do {
$dups = false;
$hash = random_string();
@ -537,7 +537,7 @@ function notification($params)
// Is this the first email notification for this parent item and user?
if (!DBA::exists('notify-threads', ['master-parent-item' => $params['parent'], 'receiver-uid' => $params['uid']])) {
Logger::log("notify_id:".intval($notify_id).", parent: ".intval($params['parent'])."uid: ".intval($params['uid']), LOGGER_DEBUG);
Logger::log("notify_id:".intval($notify_id).", parent: ".intval($params['parent'])."uid: ".intval($params['uid']), Logger::DEBUG);
$fields = ['notify-id' => $notify_id, 'master-parent-item' => $params['parent'],
'receiver-uid' => $params['uid'], 'parent-item' => 0];
@ -546,11 +546,11 @@ function notification($params)
$additional_mail_header .= "Message-ID: <${id_for_parent}>\n";
$log_msg = "include/enotify: No previous notification found for this parent:\n".
" parent: ${params['parent']}\n"." uid : ${params['uid']}\n";
Logger::log($log_msg, LOGGER_DEBUG);
Logger::log($log_msg, Logger::DEBUG);
} else {
// If not, just "follow" the thread.
$additional_mail_header .= "References: <${id_for_parent}>\nIn-Reply-To: <${id_for_parent}>\n";
Logger::log("There's already a notification for this parent.", LOGGER_DEBUG);
Logger::log("There's already a notification for this parent.", Logger::DEBUG);
}
}

12
include/items.php

@ -110,7 +110,7 @@ function query_page_info($url, $photo = "", $keywords = false, $keyword_blacklis
$data["images"][0]["src"] = $photo;
}
Logger::log('fetch page info for ' . $url . ' ' . print_r($data, true), LOGGER_DEBUG);
Logger::log('fetch page info for ' . $url . ' ' . print_r($data, true), Logger::DEBUG);
if (!$keywords && isset($data["keywords"])) {
unset($data["keywords"]);
@ -168,7 +168,7 @@ function add_page_info($url, $no_photos = false, $photo = "", $keywords = false,
function add_page_info_to_body($body, $texturl = false, $no_photos = false)
{
Logger::log('add_page_info_to_body: fetch page info for body ' . $body, LOGGER_DEBUG);
Logger::log('add_page_info_to_body: fetch page info for body ' . $body, Logger::DEBUG);
$URLSearchString = "^\[\]";
@ -252,7 +252,7 @@ function consume_feed($xml, array $importer, array $contact, &$hub, $datedir = 0
// Test - remove before flight
//$tempfile = tempnam(get_temppath(), "ostatus2");
//file_put_contents($tempfile, $xml);
Logger::log("Consume OStatus messages ", LOGGER_DEBUG);
Logger::log("Consume OStatus messages ", Logger::DEBUG);
OStatus::import($xml, $importer, $contact, $hub);
}
@ -261,7 +261,7 @@ function consume_feed($xml, array $importer, array $contact, &$hub, $datedir = 0
if ($contact['network'] === Protocol::FEED) {
if ($pass < 2) {
Logger::log("Consume feeds", LOGGER_DEBUG);
Logger::log("Consume feeds", Logger::DEBUG);
Feed::import($xml, $importer, $contact, $hub);
}
@ -269,7 +269,7 @@ function consume_feed($xml, array $importer, array $contact, &$hub, $datedir = 0
}
if ($contact['network'] === Protocol::DFRN) {
Logger::log("Consume DFRN messages", LOGGER_DEBUG);
Logger::log("Consume DFRN messages", Logger::DEBUG);
$dfrn_importer = DFRN::getImporter($contact["id"], $importer["uid"]);
if (!empty($dfrn_importer)) {
Logger::log("Now import the DFRN feed");
@ -319,7 +319,7 @@ function subscribe_to_hub($url, array $importer, array $contact, $hubmode = 'sub
$postResult = Network::post($url, $params);
Logger::log('subscribe_to_hub: returns: ' . $postResult->getReturnCode(), LOGGER_DEBUG);
Logger::log('subscribe_to_hub: returns: ' . $postResult->getReturnCode(), Logger::DEBUG);
return;

2
mod/acl.php

@ -35,7 +35,7 @@ function acl_content(App $a)
$search = $_REQUEST['query'];
}
Logger::log("Searching for ".$search." - type ".$type." conversation ".$conv_id, LOGGER_DEBUG);
Logger::log("Searching for ".$search." - type ".$type." conversation ".$conv_id, Logger::DEBUG);
if ($search != '') {
$sql_extra = "AND `name` LIKE '%%" . DBA::escape($search) . "%%'";

16
mod/admin.php

@ -911,7 +911,7 @@ function admin_page_summary(App $a)
$users+= $u['count'];
}
Logger::log('accounts: ' . print_r($accounts, true), LOGGER_DATA);
Logger::log('accounts: ' . print_r($accounts, true), Logger::DATA);
$pending = Register::getPendingCount();
@ -2400,12 +2400,12 @@ function admin_page_logs_post(App $a)
function admin_page_logs(App $a)
{
$log_choices = [
LOGGER_WARNING => 'Warning',
LOGGER_INFO => 'Info',
LOGGER_TRACE => 'Trace',
LOGGER_DEBUG => 'Debug',
LOGGER_DATA => 'Data',
LOGGER_ALL => 'All'
Logger::WARNING => 'Warning',
Logger::INFO => 'Info',
Logger::TRACE => 'Trace',
Logger::DEBUG => 'Debug',
Logger::DATA => 'Data',
Logger::ALL => 'All'
];
if (ini_get('log_errors')) {
@ -2500,7 +2500,7 @@ function admin_page_features_post(App $a)
{
BaseModule::checkFormSecurityTokenRedirectOnError('/admin/features', 'admin_manage_features');
Logger::log('postvars: ' . print_r($_POST, true), LOGGER_DATA);
Logger::log('postvars: ' . print_r($_POST, true), Logger::DATA);
$features = Feature::get(false);

6
mod/dfrn_confirm.php

@ -212,7 +212,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$params['page'] = 2;
}
Logger::log('Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params, true), LOGGER_DATA);
Logger::log('Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params, true), Logger::DATA);
/*
*
@ -224,7 +224,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$res = Network::post($dfrn_confirm, $params, null, $redirects, 120)->getBody();
Logger::log(' Confirm: received data: ' . $res, LOGGER_DATA);
Logger::log(' Confirm: received data: ' . $res, Logger::DATA);
// Now figure out what they responded. Try to be robust if the remote site is
// having difficulty and throwing up errors of some kind.
@ -430,7 +430,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
Logger::log('dfrn_confirm: requestee contacted: ' . $node);
Logger::log('dfrn_confirm: request: POST=' . print_r($_POST, true), LOGGER_DATA);
Logger::log('dfrn_confirm: request: POST=' . print_r($_POST, true), Logger::DATA);
// If $aes_key is set, both of these items require unpacking from the hex transport encoding.

20
mod/dfrn_notify.php

@ -18,7 +18,7 @@ use Friendica\Protocol\Diaspora;
require_once 'include/items.php';
function dfrn_notify_post(App $a) {
Logger::log(__function__, LOGGER_TRACE);
Logger::log(__function__, Logger::TRACE);
$postdata = file_get_contents('php://input');
@ -118,7 +118,7 @@ function dfrn_notify_post(App $a) {
$importer = Contact::updateSslPolicy($importer, $ssl_policy);
Logger::log('data: ' . $data, LOGGER_DATA);
Logger::log('data: ' . $data, Logger::DATA);
if ($dissolve == 1) {
// Relationship is dissolved permanently
@ -140,7 +140,7 @@ function dfrn_notify_post(App $a) {
}
$rawkey = hex2bin(trim($key));
Logger::log('rino: md5 raw key: ' . md5($rawkey), LOGGER_DATA);
Logger::log('rino: md5 raw key: ' . md5($rawkey), Logger::DATA);
$final_key = '';
@ -170,10 +170,10 @@ function dfrn_notify_post(App $a) {
System::xmlExit(0, "Invalid sent version '$rino_remote'");
}
Logger::log('rino: decrypted data: ' . $data, LOGGER_DATA);
Logger::log('rino: decrypted data: ' . $data, Logger::DATA);
}
Logger::log('Importing post from ' . $importer['addr'] . ' to ' . $importer['nickname'] . ' with the RINO ' . $rino_remote . ' encryption.', LOGGER_DEBUG);
Logger::log('Importing post from ' . $importer['addr'] . ' to ' . $importer['nickname'] . ' with the RINO ' . $rino_remote . ' encryption.', Logger::DEBUG);
$ret = DFRN::import($data, $importer);
System::xmlExit($ret, 'Processed');
@ -204,7 +204,7 @@ function dfrn_dispatch_public($postdata)
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
Logger::log('Importing post from ' . $msg['author'] . ' with the public envelope.', LOGGER_DEBUG);
Logger::log('Importing post from ' . $msg['author'] . ' with the public envelope.', Logger::DEBUG);
// Now we should be able to import it
$ret = DFRN::import($msg['message'], $importer);
@ -237,7 +237,7 @@ function dfrn_dispatch_private($user, $postdata)
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
Logger::log('Importing post from ' . $msg['author'] . ' to ' . $user['nickname'] . ' with the private envelope.', LOGGER_DEBUG);
Logger::log('Importing post from ' . $msg['author'] . ' to ' . $user['nickname'] . ' with the private envelope.', Logger::DEBUG);
// Now we should be able to import it
$ret = DFRN::import($msg['message'], $importer);
@ -277,7 +277,7 @@ function dfrn_notify_content(App $a) {
'type' => $type, 'last_update' => $last_update];
DBA::insert('challenge', $fields);
Logger::log('challenge=' . $hash, LOGGER_DATA);
Logger::log('challenge=' . $hash, Logger::DATA);
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $a->argv[1]]);
if (!DBA::isResult($user)) {
@ -317,7 +317,7 @@ function dfrn_notify_content(App $a) {
killme();
}
Logger::log("Remote rino version: ".$rino_remote." for ".$importer["url"], LOGGER_DATA);
Logger::log("Remote rino version: ".$rino_remote." for ".$importer["url"], Logger::DATA);
$challenge = '';
$encrypted_id = '';
@ -345,7 +345,7 @@ function dfrn_notify_content(App $a) {
$rino = Config::get('system', 'rino_encrypt');
$rino = intval($rino);
Logger::log("Local rino version: ". $rino, LOGGER_DATA);
Logger::log("Local rino version: ". $rino, Logger::DATA);
// if requested rino is lower than enabled local rino, lower local rino version
// if requested rino is higher than enabled local rino, reply with local rino

12
mod/dfrn_poll.php

@ -105,7 +105,7 @@ function dfrn_poll_init(App $a)
if (DBA::isResult($r)) {
$s = Network::fetchUrl($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
Logger::log("dfrn_poll: old profile returns " . $s, LOGGER_DATA);
Logger::log("dfrn_poll: old profile returns " . $s, Logger::DATA);
if (strlen($s)) {
$xml = XML::parseString($s);
@ -192,7 +192,7 @@ function dfrn_poll_init(App $a)
}
if ($final_dfrn_id != $orig_id) {
Logger::log('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
Logger::log('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, Logger::DEBUG);
// did not decode properly - cannot trust this site
System::xmlExit(3, 'Bad decryption');
}
@ -284,7 +284,7 @@ function dfrn_poll_post(App $a)
}
if ($final_dfrn_id != $orig_id) {
Logger::log('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
Logger::log('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, Logger::DEBUG);
// did not decode properly - cannot trust this site
System::xmlExit(3, 'Bad decryption');
}
@ -373,7 +373,7 @@ function dfrn_poll_post(App $a)
// NOTREACHED
} else {
// Update the writable flag if it changed
Logger::log('dfrn_poll: post request feed: ' . print_r($_POST, true), LOGGER_DATA);
Logger::log('dfrn_poll: post request feed: ' . print_r($_POST, true), Logger::DATA);
if ($dfrn_version >= 2.21) {
if ($perm === 'rw') {
$writable = 1;
@ -511,12 +511,12 @@ function dfrn_poll_content(App $a)
])->getBody();
}
Logger::log("dfrn_poll: sec profile: " . $s, LOGGER_DATA);
Logger::log("dfrn_poll: sec profile: " . $s, Logger::DATA);
if (strlen($s) && strstr($s, '<?xml')) {
$xml = XML::parseString($s);
Logger::log('dfrn_poll: profile: parsed xml: ' . print_r($xml, true), LOGGER_DATA);
Logger::log('dfrn_poll: profile: parsed xml: ' . print_r($xml, true), Logger::DATA);
Logger::log('dfrn_poll: secure profile: challenge: ' . $xml->challenge . ' expecting ' . $hash);
Logger::log('dfrn_poll: secure profile: sec: ' . $xml->sec . ' expecting ' . $sec);

2
mod/dfrn_request.php

@ -298,7 +298,7 @@ function dfrn_request_post(App $a)
$network = Protocol::DFRN;
}
Logger::log('dfrn_request: url: ' . $url . ',network=' . $network, LOGGER_DEBUG);
Logger::log('dfrn_request: url: ' . $url . ',network=' . $network, Logger::DEBUG);
if ($network === Protocol::DFRN) {
$ret = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `self` = 0 LIMIT 1",

2
mod/display.php

@ -75,7 +75,7 @@ function display_init(App $a)
}
if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
Logger::log('Directly serving XML for id '.$item["id"], LOGGER_DEBUG);
Logger::log('Directly serving XML for id '.$item["id"], Logger::DEBUG);
displayShowFeed($item["id"], false);
}

2
mod/events.php

@ -48,7 +48,7 @@ function events_init(App $a)
function events_post(App $a)
{
Logger::log('post: ' . print_r($_REQUEST, true), LOGGER_DATA);
Logger::log('post: ' . print_r($_REQUEST, true), Logger::DATA);
if (!local_user()) {
return;

8
mod/item.php

@ -57,7 +57,7 @@ function item_post(App $a) {
Addon::callHooks('post_local_start', $_REQUEST);
Logger::log('postvars ' . print_r($_REQUEST, true), LOGGER_DATA);
Logger::log('postvars ' . print_r($_REQUEST, true), Logger::DATA);
$api_source = defaults($_REQUEST, 'api_source', false);
@ -73,7 +73,7 @@ function item_post(App $a) {
*/
if (!$preview && !empty($_REQUEST['post_id_random'])) {
if (!empty($_SESSION['post-random']) && $_SESSION['post-random'] == $_REQUEST['post_id_random']) {
Logger::log("item post: duplicate post", LOGGER_DEBUG);
Logger::log("item post: duplicate post", Logger::DEBUG);
item_post_return(System::baseUrl(), $api_source, $return_path);
} else {
$_SESSION['post-random'] = $_REQUEST['post_id_random'];
@ -154,7 +154,7 @@ function item_post(App $a) {
// Check for multiple posts with the same message id (when the post was created via API)
if (($message_id != '') && ($profile_uid != 0)) {
if (Item::exists(['uri' => $message_id, 'uid' => $profile_uid])) {
Logger::log("Message with URI ".$message_id." already exists for user ".$profile_uid, LOGGER_DEBUG);
Logger::log("Message with URI ".$message_id." already exists for user ".$profile_uid, Logger::DEBUG);
return 0;
}
}
@ -862,7 +862,7 @@ function item_post_return($baseurl, $api_source, $return_path)
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
}
Logger::log('post_json: ' . print_r($json, true), LOGGER_DEBUG);
Logger::log('post_json: ' . print_r($json, true), Logger::DEBUG);
echo json_encode($json);
killme();

10
mod/nodeinfo.php

@ -204,22 +204,22 @@ function nodeinfo_cron() {
Config::set('nodeinfo', 'active_users_halfyear', $active_users_halfyear);
Config::set('nodeinfo', 'active_users_monthly', $active_users_monthly);
Logger::log('total_users: ' . $total_users . '/' . $active_users_halfyear. '/' . $active_users_monthly, LOGGER_DEBUG);
Logger::log('total_users: ' . $total_users . '/' . $active_users_halfyear. '/' . $active_users_monthly, Logger::DEBUG);
}
$local_posts = DBA::count('thread', ["`wall` AND NOT `deleted` AND `uid` != 0"]);
Config::set('nodeinfo', 'local_posts', $local_posts);
Logger::log('local_posts: ' . $local_posts, LOGGER_DEBUG);
Logger::log('local_posts: ' . $local_posts, Logger::DEBUG);
$local_comments = DBA::count('item', ["`origin` AND `id` != `parent` AND NOT `deleted` AND `uid` != 0"]);
Config::set('nodeinfo', 'local_comments', $local_comments);
Logger::log('local_comments: ' . $local_comments, LOGGER_DEBUG);
Logger::log('local_comments: ' . $local_comments, Logger::DEBUG);
// Now trying to register
$url = 'http://the-federation.info/register/'.$a->getHostName();
Logger::log('registering url: '.$url, LOGGER_DEBUG);
Logger::log('registering url: '.$url, Logger::DEBUG);
$ret = Network::fetchUrl($url);
Logger::log('registering answer: '.$ret, LOGGER_DEBUG);
Logger::log('registering answer: '.$ret, Logger::DEBUG);
Logger::log('cron_end');
}

2
mod/openid.php

@ -17,7 +17,7 @@ function openid_content(App $a) {
if($noid)
$a->internalRedirect();
Logger::log('mod_openid ' . print_r($_REQUEST,true), LOGGER_DATA);
Logger::log('mod_openid ' . print_r($_REQUEST,true), Logger::DATA);
if((x($_GET,'openid_mode')) && (x($_SESSION,'openid'))) {

16
mod/photos.php

@ -142,9 +142,9 @@ function photos_init(App $a) {
function photos_post(App $a)
{
Logger::log('mod-photos: photos_post: begin' , LOGGER_DEBUG);
Logger::log('mod_photos: REQUEST ' . print_r($_REQUEST, true), LOGGER_DATA);
Logger::log('mod_photos: FILES ' . print_r($_FILES, true), LOGGER_DATA);
Logger::log('mod-photos: photos_post: begin' , Logger::DEBUG);
Logger::log('mod_photos: REQUEST ' . print_r($_REQUEST, true), Logger::DATA);
Logger::log('mod_photos: FILES ' . print_r($_FILES, true), Logger::DATA);
$phototypes = Image::supportedTypes();
@ -707,7 +707,7 @@ function photos_post(App $a)
$album = !empty($_REQUEST['album']) ? notags(trim($_REQUEST['album'])) : '';
$newalbum = !empty($_REQUEST['newalbum']) ? notags(trim($_REQUEST['newalbum'])) : '';
Logger::log('mod/photos.php: photos_post(): album= ' . $album . ' newalbum= ' . $newalbum , LOGGER_DEBUG);
Logger::log('mod/photos.php: photos_post(): album= ' . $album . ' newalbum= ' . $newalbum , Logger::DEBUG);
if (!strlen($album)) {
if (strlen($newalbum)) {
@ -800,7 +800,7 @@ function photos_post(App $a)
$type = Image::guessType($filename);
}
Logger::log('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes', LOGGER_DEBUG);
Logger::log('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes', Logger::DEBUG);
$maximagesize = Config::get('system', 'maximagesize');
@ -820,14 +820,14 @@ function photos_post(App $a)
return;
}
Logger::log('mod/photos.php: photos_post(): loading the contents of ' . $src , LOGGER_DEBUG);
Logger::log('mod/photos.php: photos_post(): loading the contents of ' . $src , Logger::DEBUG);
$imagedata = @file_get_contents($src);
$image = new Image($imagedata, $type);
if (!$image->isValid()) {
Logger::log('mod/photos.php: photos_post(): unable to process image' , LOGGER_DEBUG);
Logger::log('mod/photos.php: photos_post(): unable to process image' , Logger::DEBUG);
notice(L10n::t('Unable to process image.') . EOL);
@unlink($src);
$foo = 0;
@ -856,7 +856,7 @@ function photos_post(App $a)
$r = Photo::store($image, $page_owner_uid, $visitor, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
if (!$r) {
Logger::log('mod/photos.php: photos_post(): image store failed', LOGGER_DEBUG);
Logger::log('mod/photos.php: photos_post(): image store failed', Logger::DEBUG);
notice(L10n::t('Image upload failed.') . EOL);
killme();
}

10
mod/poco.php

@ -122,7 +122,7 @@ function poco_init(App $a) {
$itemsPerPage = ((x($_GET, 'count') && intval($_GET['count'])) ? intval($_GET['count']) : $totalResults);
if ($global) {
Logger::log("Start global query", LOGGER_DEBUG);
Logger::log("Start global query", Logger::DEBUG);
$contacts = q("SELECT * FROM `gcontact` WHERE `updated` > '%s' AND NOT `hide` AND `network` IN ('%s', '%s', '%s') AND `updated` > `last_failure`
ORDER BY `updated` DESC LIMIT %d, %d",
DBA::escape($update_limit),
@ -133,7 +133,7 @@ function poco_init(App $a) {
intval($itemsPerPage)
);
} elseif ($system_mode) {
Logger::log("Start system mode query", LOGGER_DEBUG);
Logger::log("Start system mode query", Logger::DEBUG);
$contacts = q("SELECT `contact`.*, `profile`.`about` AS `pabout`, `profile`.`locality` AS `plocation`, `profile`.`pub_keywords`,
`profile`.`gender` AS `pgender`, `profile`.`address` AS `paddress`, `profile`.`region` AS `pregion`,
`profile`.`postal-code` AS `ppostalcode`, `profile`.`country-name` AS `pcountry`, `user`.`account-type`
@ -145,7 +145,7 @@ function poco_init(App $a) {
intval($itemsPerPage)
);
} else {
Logger::log("Start query for user " . $user['nickname'], LOGGER_DEBUG);
Logger::log("Start query for user " . $user['nickname'], Logger::DEBUG);
$contacts = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
AND (`success_update` >= `failure_update` OR `last-item` >= `failure_update`)
AND `network` IN ('%s', '%s', '%s', '%s') $sql_extra LIMIT %d, %d",
@ -158,7 +158,7 @@ function poco_init(App $a) {
intval($itemsPerPage)
);
}
Logger::log("Query done", LOGGER_DEBUG);
Logger::log("Query done", Logger::DEBUG);
$ret = [];
if (x($_GET, 'sorted')) {
@ -370,7 +370,7 @@ function poco_init(App $a) {
} else {
System::httpExit(500);
}
Logger::log("End of poco", LOGGER_DEBUG);
Logger::log("End of poco", Logger::DEBUG);
if ($format === 'xml') {
header('Content-type: text/xml');

2
mod/poke.php

@ -54,7 +54,7 @@ function poke_init(App $a)
$parent = (x($_GET,'parent') ? intval($_GET['parent']) : 0);
Logger::log('poke: verb ' . $verb . ' contact ' . $contact_id, LOGGER_DEBUG);
Logger::log('poke: verb ' . $verb . ' contact ' . $contact_id, Logger::DEBUG);
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",

2
mod/profile.php

@ -38,7 +38,7 @@ function profile_init(App $a)
if (DBA::isResult($r)) {
$a->internalRedirect('profile/' . $r[0]['nickname']);
} else {
Logger::log('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
Logger::log('profile error: mod_profile ' . $a->query_string, Logger::DEBUG);
notice(L10n::t('Requested profile is not available.') . EOL);
$a->error = 404;
return;

4
mod/pubsub.php

@ -41,7 +41,7 @@ function pubsub_init(App $a)
$hub_verify = notags(trim(defaults($_GET, 'hub_verify_token', '')));
Logger::log('Subscription from ' . $_SERVER['REMOTE_ADDR'] . ' Mode: ' . $hub_mode . ' Nick: ' . $nick);
Logger::log('Data: ' . print_r($_GET,true), LOGGER_DATA);
Logger::log('Data: ' . print_r($_GET,true), Logger::DATA);
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
@ -89,7 +89,7 @@ function pubsub_post(App $a)
$xml = file_get_contents('php://input');
Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
Logger::log('Data: ' . $xml, LOGGER_DATA);
Logger::log('Data: ' . $xml, Logger::DATA);
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );

14
mod/receive.php

@ -42,7 +42,7 @@ function receive_post(App $a)
// It is an application/x-www-form-urlencoded
Logger::log('mod-diaspora: receiving post', LOGGER_DEBUG);
Logger::log('mod-diaspora: receiving post', Logger::DEBUG);
if (empty($_POST['xml'])) {
$postdata = file_get_contents("php://input");
@ -50,29 +50,29 @@ function receive_post(App $a)
System::httpExit(500);
}
Logger::log('mod-diaspora: message is in the new format', LOGGER_DEBUG);
Logger::log('mod-diaspora: message is in the new format', Logger::DEBUG);
$msg = Diaspora::decodeRaw($importer, $postdata);
} else {
$xml = urldecode($_POST['xml']);
Logger::log('mod-diaspora: decode message in the old format', LOGGER_DEBUG);
Logger::log('mod-diaspora: decode message in the old format', Logger::DEBUG);
$msg = Diaspora::decode($importer, $xml);
if ($public && !$msg) {
Logger::log('mod-diaspora: decode message in the new format', LOGGER_DEBUG);
Logger::log('mod-diaspora: decode message in the new format', Logger::DEBUG);
$msg = Diaspora::decodeRaw($importer, $xml);
}
}
Logger::log('mod-diaspora: decoded', LOGGER_DEBUG);
Logger::log('mod-diaspora: decoded', Logger::DEBUG);
Logger::log('mod-diaspora: decoded msg: ' . print_r($msg, true), LOGGER_DATA);
Logger::log('mod-diaspora: decoded msg: ' . print_r($msg, true), Logger::DATA);
if (!is_array($msg)) {
System::httpExit(500);
}
Logger::log('mod-diaspora: dispatching', LOGGER_DEBUG);
Logger::log('mod-diaspora: dispatching', Logger::DEBUG);
$ret = true;
if ($public) {

8
mod/redir.php

@ -52,7 +52,7 @@ function redir_init(App $a) {
if (!empty($a->contact['id']) && $a->contact['id'] == $cid) {
// Local user is already authenticated.
$target_url = defaults($url, $contact_url);
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, LOGGER_DEBUG);
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG);
$a->redirect($target_url);
}
}
@ -73,7 +73,7 @@ function redir_init(App $a) {
if ($v['uid'] == $_SESSION['visitor_visiting'] && $v['cid'] == $_SESSION['visitor_id']) {
// Remote user is already authenticated.
$target_url = defaults($url, $contact_url);
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, LOGGER_DEBUG);
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG);
$a->redirect($target_url);
}
}
@ -99,7 +99,7 @@ function redir_init(App $a) {
'sec' => $sec, 'expire' => time() + 45];
DBA::insert('profile_check', $fields);
Logger::log('mod_redir: ' . $contact['name'] . ' ' . $sec, LOGGER_DEBUG);
Logger::log('mod_redir: ' . $contact['name'] . ' ' . $sec, Logger::DEBUG);
$dest = (!empty($url) ? '&destination_url=' . $url : '');
@ -121,7 +121,7 @@ function redir_init(App $a) {
$url .= $separator . 'zrl=' . urlencode($my_profile);
}
Logger::log('redirecting to ' . $url, LOGGER_DEBUG);
Logger::log('redirecting to ' . $url, Logger::DEBUG);
$a->redirect($url);
}

4
mod/salmon.php

@ -21,7 +21,7 @@ function salmon_post(App $a, $xml = '') {
$xml = file_get_contents('php://input');
}
Logger::log('new salmon ' . $xml, LOGGER_DATA);
Logger::log('new salmon ' . $xml, Logger::DATA);
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
$mentions = (($a->argc > 2 && $a->argv[2] === 'mention') ? true : false);
@ -108,7 +108,7 @@ function salmon_post(App $a, $xml = '') {
$m = base64url_decode($key_info[1]);
$e = base64url_decode($key_info[2]);
Logger::log('key details: ' . print_r($key_info,true), LOGGER_DEBUG);
Logger::log('key details: ' . print_r($key_info,true), Logger::DEBUG);
$pubkey = Crypto::meToPem($m, $e);

8
mod/search.php

@ -205,7 +205,7 @@ function search_content(App $a) {
$pager = new Pager($a->query_string);
if ($tag) {
Logger::log("Start tag search for '".$search."'", LOGGER_DEBUG);
Logger::log("Start tag search for '".$search."'", Logger::DEBUG);
$condition = ["(`uid` = 0 OR (`uid` = ? AND NOT `global`))
AND `otype` = ? AND `type` = ? AND `term` = ?",
@ -228,7 +228,7 @@ function search_content(App $a) {
$r = [];
}
} else {
Logger::log("Start fulltext search for '".$search."'", LOGGER_DEBUG);
Logger::log("Start fulltext search for '".$search."'", Logger::DEBUG);
$condition = ["(`uid` = 0 OR (`uid` = ? AND NOT `global`))
AND `body` LIKE CONCAT('%',?,'%')",
@ -255,12 +255,12 @@ function search_content(App $a) {
'$title' => $title
]);
Logger::log("Start Conversation for '".$search."'", LOGGER_DEBUG);
Logger::log("Start Conversation for '".$search."'", Logger::DEBUG);
$o .= conversation($a, $r, $pager, 'search', false, false, 'commented', local_user());
$o .= $pager->renderMinimal(count($r));
Logger::log("Done '".$search."'", LOGGER_DEBUG);
Logger::log("Done '".$search."'", Logger::DEBUG);
return $o;
}

2
mod/statistics_json.php

@ -57,6 +57,6 @@ function statistics_json_init(App $a) {
header("Content-Type: application/json");
echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
Logger::log("statistics_init: printed " . print_r($statistics, true), LOGGER_DATA);
Logger::log("statistics_init: printed " . print_r($statistics, true), Logger::DATA);
killme();
}

10
mod/wall_upload.php

@ -20,7 +20,7 @@ use Friendica\Object\Image;
function wall_upload_post(App $a, $desktopmode = true)
{
Logger::log("wall upload: starting new upload", LOGGER_DEBUG);
Logger::log("wall upload: starting new upload", Logger::DEBUG);
$r_json = (x($_GET, 'response') && $_GET['response'] == 'json');
$album = (x($_GET, 'album') ? notags(trim($_GET['album'])) : '');
@ -188,7 +188,7 @@ function wall_upload_post(App $a, $desktopmode = true)
}
Logger::log("File upload src: " . $src . " - filename: " . $filename .
" - size: " . $filesize . " - type: " . $filetype, LOGGER_DEBUG);
" - size: " . $filesize . " - type: " . $filetype, Logger::DEBUG);
$maximagesize = Config::get('system', 'maximagesize');
@ -226,7 +226,7 @@ function wall_upload_post(App $a, $desktopmode = true)
}
if ($max_length > 0) {
$Image->scaleDown($max_length);
Logger::log("File upload: Scaling picture to new size " . $max_length, LOGGER_DEBUG);
Logger::log("File upload: Scaling picture to new size " . $max_length, Logger::DEBUG);
}
$width = $Image->getWidth();
@ -301,11 +301,11 @@ function wall_upload_post(App $a, $desktopmode = true)
echo json_encode(['picture' => $picture]);
killme();
}
Logger::log("upload done", LOGGER_DEBUG);
Logger::log("upload done", Logger::DEBUG);
return $picture;
}
Logger::log("upload done", LOGGER_DEBUG);
Logger::log("upload done", Logger::DEBUG);
if ($r_json) {
echo json_encode(['ok' => true]);

22
src/App.php

@ -1101,10 +1101,10 @@ class App
$processlist = DBA::processlist();
if ($processlist['list'] != '') {
Core\Logger::log('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], LOGGER_DEBUG);
Core\Logger::log('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], Logger::DEBUG);
if ($processlist['amount'] > $max_processes) {
Core\Logger::log('Processcheck: Maximum number of processes for ' . $process . ' tasks (' . $max_processes . ') reached.', LOGGER_DEBUG);
Core\Logger::log('Processcheck: Maximum number of processes for ' . $process . ' tasks (' . $max_processes . ') reached.', Logger::DEBUG);
return true;
}
}
@ -1150,7 +1150,7 @@ class App
$reached = ($free < $min_memory);
if ($reached) {
Core\Logger::log('Minimal memory reached: ' . $free . '/' . $meminfo['MemTotal'] . ' - limit ' . $min_memory, LOGGER_DEBUG);
Core\Logger::log('Minimal memory reached: ' . $free . '/' . $meminfo['MemTotal'] . ' - limit ' . $min_memory, Logger::DEBUG);
}
return $reached;
@ -1222,7 +1222,7 @@ class App
$resource = proc_open($cmdline . ' &', [], $foo, $this->getBasePath());
}
if (!is_resource($resource)) {
Core\Logger::log('We got no resource for command ' . $cmdline, LOGGER_DEBUG);
Core\Logger::log('We got no resource for command ' . $cmdline, Logger::DEBUG);
return;
}
proc_close($resource);
@ -1253,27 +1253,27 @@ class App
public static function isDirectoryUsable($directory, $check_writable = true)
{
if ($directory == '') {
Core\Logger::log('Directory is empty. This shouldn\'t happen.', LOGGER_DEBUG);
Core\Logger::log('Directory is empty. This shouldn\'t happen.', Logger::DEBUG);
return false;
}
if (!file_exists($directory)) {
Core\Logger::log('Path "' . $directory . '" does not exist for user ' . self::getSystemUser(), LOGGER_DEBUG);
Core\Logger::log('Path "' . $directory . '" does not exist for user ' . self::getSystemUser(), Logger::DEBUG);
return false;
}
if (is_file($directory)) {
Core\Logger::log('Path "' . $directory . '" is a file for user ' . self::getSystemUser(), LOGGER_DEBUG);
Core\Logger::log('Path "' . $directory . '" is a file for user ' . self::getSystemUser(), Logger::DEBUG);
return false;