Logger Levels

update logger levels in calls
This commit is contained in:
Adam Magness 2018-10-30 09:58:45 -04:00
parent 91ef9f238c
commit 50da89d861
86 changed files with 673 additions and 673 deletions

View file

@ -193,7 +193,7 @@ class APContact extends BaseObject
// Update the gcontact table
DBA::update('gcontact', $contact_fields, ['nurl' => normalise_link($url)]);
Logger::log('Updated profile for ' . $url, LOGGER_DEBUG);
Logger::log('Updated profile for ' . $url, Logger::DEBUG);
return $apcontact;
}

View file

@ -587,7 +587,7 @@ class Contact extends BaseObject
return;
}
} elseif (!isset($contact['url'])) {
Logger::log('Empty contact: ' . json_encode($contact) . ' - ' . System::callstack(20), LOGGER_DEBUG);
Logger::log('Empty contact: ' . json_encode($contact) . ' - ' . System::callstack(20), Logger::DEBUG);
}
// Contact already archived or "self" contact? => nothing to do
@ -1028,7 +1028,7 @@ class Contact extends BaseObject
*/
public static function getIdForURL($url, $uid = 0, $no_update = false, $default = [], $in_loop = false)
{
Logger::log("Get contact data for url " . $url . " and user " . $uid . " - " . System::callstack(), LOGGER_DEBUG);
Logger::log("Get contact data for url " . $url . " and user " . $uid . " - " . System::callstack(), Logger::DEBUG);
$contact_id = 0;

View file

@ -84,12 +84,12 @@ class Conversation
}
if (!DBA::update('conversation', $conversation, ['item-uri' => $conversation['item-uri']], $old_conv)) {
Logger::log('Conversation: update for ' . $conversation['item-uri'] . ' from ' . $old_conv['protocol'] . ' to ' . $conversation['protocol'] . ' failed',
LOGGER_DEBUG);
Logger::DEBUG);
}
} else {
if (!DBA::insert('conversation', $conversation, true)) {
Logger::log('Conversation: insert for ' . $conversation['item-uri'] . ' (protocol ' . $conversation['protocol'] . ') failed',
LOGGER_DEBUG);
Logger::DEBUG);
}
}
}

View file

@ -225,7 +225,7 @@ class Event extends BaseObject
}
DBA::delete('event', ['id' => $event_id]);
Logger::log("Deleted event ".$event_id, LOGGER_DEBUG);
Logger::log("Deleted event ".$event_id, Logger::DEBUG);
}
/**

View file

@ -589,7 +589,7 @@ class GContact
}
if ($new_url != $url) {
Logger::log("Cleaned contact url ".$url." to ".$new_url." - Called by: ".System::callstack(), LOGGER_DEBUG);
Logger::log("Cleaned contact url ".$url." to ".$new_url." - Called by: ".System::callstack(), Logger::DEBUG);
}
return $new_url;
@ -606,7 +606,7 @@ class GContact
if (($contact["network"] == Protocol::OSTATUS) && PortableContact::alternateOStatusUrl($contact["url"])) {
$data = Probe::uri($contact["url"]);
if ($contact["network"] == Protocol::OSTATUS) {
Logger::log("Fix primary url from ".$contact["url"]." to ".$data["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
Logger::log("Fix primary url from ".$contact["url"]." to ".$data["url"]." - Called by: ".System::callstack(), Logger::DEBUG);
$contact["url"] = $data["url"];
$contact["addr"] = $data["addr"];
$contact["alias"] = $data["alias"];
@ -630,12 +630,12 @@ class GContact
$last_contact_str = '';
if (empty($contact["network"])) {
Logger::log("Empty network for contact url ".$contact["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
Logger::log("Empty network for contact url ".$contact["url"]." - Called by: ".System::callstack(), Logger::DEBUG);
return false;
}
if (in_array($contact["network"], [Protocol::PHANTOM])) {
Logger::log("Invalid network for contact url ".$contact["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
Logger::log("Invalid network for contact url ".$contact["url"]." - Called by: ".System::callstack(), Logger::DEBUG);
return false;
}
@ -703,7 +703,7 @@ class GContact
DBA::unlock();
if ($doprobing) {
Logger::log("Last Contact: ". $last_contact_str." - Last Failure: ".$last_failure_str." - Checking: ".$contact["url"], LOGGER_DEBUG);
Logger::log("Last Contact: ". $last_contact_str." - Last Failure: ".$last_failure_str." - Checking: ".$contact["url"], Logger::DEBUG);
Worker::add(PRIORITY_LOW, 'GProbe', $contact["url"]);
}
@ -808,19 +808,19 @@ class GContact
if ((($contact["generation"] > 0) && ($contact["generation"] <= $public_contact[0]["generation"])) || ($public_contact[0]["generation"] == 0)) {
foreach ($fields as $field => $data) {
if ($contact[$field] != $public_contact[0][$field]) {
Logger::log("Difference for contact ".$contact["url"]." in field '".$field."'. New value: '".$contact[$field]."', old value '".$public_contact[0][$field]."'", LOGGER_DEBUG);
Logger::log("Difference for contact ".$contact["url"]." in field '".$field."'. New value: '".$contact[$field]."', old value '".$public_contact[0][$field]."'", Logger::DEBUG);
$update = true;
}
}
if ($contact["generation"] < $public_contact[0]["generation"]) {
Logger::log("Difference for contact ".$contact["url"]." in field 'generation'. new value: '".$contact["generation"]."', old value '".$public_contact[0]["generation"]."'", LOGGER_DEBUG);
Logger::log("Difference for contact ".$contact["url"]." in field 'generation'. new value: '".$contact["generation"]."', old value '".$public_contact[0]["generation"]."'", Logger::DEBUG);
$update = true;
}
}
if ($update) {
Logger::log("Update gcontact for ".$contact["url"], LOGGER_DEBUG);
Logger::log("Update gcontact for ".$contact["url"], Logger::DEBUG);
$condition = ['`nurl` = ? AND (`generation` = 0 OR `generation` >= ?)',
normalise_link($contact["url"]), $contact["generation"]];
$contact["updated"] = DateTimeFormat::utc($contact["updated"]);
@ -844,7 +844,7 @@ class GContact
// The quality of the gcontact table is mostly lower than the public contact
$public_contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link($contact["url"]), 'uid' => 0]);
if (DBA::isResult($public_contact)) {
Logger::log("Update public contact ".$public_contact["id"], LOGGER_DEBUG);
Logger::log("Update public contact ".$public_contact["id"], Logger::DEBUG);
Contact::updateAvatar($contact["photo"], 0, $public_contact["id"]);
@ -886,7 +886,7 @@ class GContact
$data = Probe::uri($url);
if (in_array($data["network"], [Protocol::PHANTOM])) {
Logger::log("Invalid network for contact url ".$data["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
Logger::log("Invalid network for contact url ".$data["url"]." - Called by: ".System::callstack(), Logger::DEBUG);
return;
}
@ -917,7 +917,7 @@ class GContact
);
if (!DBA::isResult($r)) {
Logger::log('Cannot find user with uid=' . $uid, LOGGER_INFO);
Logger::log('Cannot find user with uid=' . $uid, Logger::INFO);
return false;
}
@ -954,7 +954,7 @@ class GContact
*/
public static function fetchGsUsers($server)
{
Logger::log("Fetching users from GNU Social server ".$server, LOGGER_DEBUG);
Logger::log("Fetching users from GNU Social server ".$server, Logger::DEBUG);
$url = $server."/main/statistics";

View file

@ -984,12 +984,12 @@ class Item extends BaseObject
'icid', 'iaid', 'psid'];
$item = self::selectFirst($fields, ['id' => $item_id]);
if (!DBA::isResult($item)) {
Logger::log('Item with ID ' . $item_id . " hasn't been found.", LOGGER_DEBUG);
Logger::log('Item with ID ' . $item_id . " hasn't been found.", Logger::DEBUG);
return false;
}
if ($item['deleted']) {
Logger::log('Item with ID ' . $item_id . ' has already been deleted.', LOGGER_DEBUG);
Logger::log('Item with ID ' . $item_id . ' has already been deleted.', Logger::DEBUG);
return false;
}
@ -1090,7 +1090,7 @@ class Item extends BaseObject
}
}
Logger::log('Item with ID ' . $item_id . " has been deleted.", LOGGER_DEBUG);
Logger::log('Item with ID ' . $item_id . " has been deleted.", Logger::DEBUG);
return true;
}
@ -1193,7 +1193,7 @@ class Item extends BaseObject
if (!empty($contact_id)) {
return $contact_id;
}
Logger::log('Missing contact-id. Called by: '.System::callstack(), LOGGER_DEBUG);
Logger::log('Missing contact-id. Called by: '.System::callstack(), Logger::DEBUG);
/*
* First we are looking for a suitable contact that matches with the author of the post
* This is done only for comments
@ -1214,7 +1214,7 @@ class Item extends BaseObject
$contact_id = $self["id"];
}
}
Logger::log("Contact-id was missing for post ".$item['guid']." from user id ".$item['uid']." - now set to ".$contact_id, LOGGER_DEBUG);
Logger::log("Contact-id was missing for post ".$item['guid']." from user id ".$item['uid']." - now set to ".$contact_id, Logger::DEBUG);
return $contact_id;
}
@ -1299,7 +1299,7 @@ class Item extends BaseObject
$item['gravity'] = GRAVITY_COMMENT;
} else {
$item['gravity'] = GRAVITY_UNKNOWN; // Should not happen
Logger::log('Unknown gravity for verb: ' . $item['verb'], LOGGER_DEBUG);
Logger::log('Unknown gravity for verb: ' . $item['verb'], Logger::DEBUG);
}
$uid = intval($item['uid']);
@ -1316,7 +1316,7 @@ class Item extends BaseObject
$expire_date = time() - ($expire_interval * 86400);
$created_date = strtotime($item['created']);
if ($created_date < $expire_date) {
Logger::log('item-store: item created ('.date('c', $created_date).') before expiration time ('.date('c', $expire_date).'). ignored. ' . print_r($item,true), LOGGER_DEBUG);
Logger::log('item-store: item created ('.date('c', $created_date).') before expiration time ('.date('c', $expire_date).'). ignored. ' . print_r($item,true), Logger::DEBUG);
return 0;
}
}
@ -1427,17 +1427,17 @@ class Item extends BaseObject
}
if ($item['network'] == Protocol::PHANTOM) {
Logger::log('Missing network. Called by: '.System::callstack(), LOGGER_DEBUG);
Logger::log('Missing network. Called by: '.System::callstack(), Logger::DEBUG);
$item['network'] = Protocol::DFRN;
Logger::log("Set network to " . $item["network"] . " for " . $item["uri"], LOGGER_DEBUG);
Logger::log("Set network to " . $item["network"] . " for " . $item["uri"], Logger::DEBUG);
}
// Checking if there is already an item with the same guid
Logger::log('Checking for an item for user '.$item['uid'].' on network '.$item['network'].' with the guid '.$item['guid'], LOGGER_DEBUG);
Logger::log('Checking for an item for user '.$item['uid'].' on network '.$item['network'].' with the guid '.$item['guid'], Logger::DEBUG);
$condition = ['guid' => $item['guid'], 'network' => $item['network'], 'uid' => $item['uid']];
if (self::exists($condition)) {
Logger::log('found item with guid '.$item['guid'].' for user '.$item['uid'].' on network '.$item['network'], LOGGER_DEBUG);
Logger::log('found item with guid '.$item['guid'].' for user '.$item['uid'].' on network '.$item['network'], Logger::DEBUG);
return 0;
}
@ -1518,15 +1518,15 @@ class Item extends BaseObject
}
// If its a post from myself then tag the thread as "mention"
Logger::log("Checking if parent ".$parent_id." has to be tagged as mention for user ".$item['uid'], LOGGER_DEBUG);
Logger::log("Checking if parent ".$parent_id." has to be tagged as mention for user ".$item['uid'], Logger::DEBUG);
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $item['uid']]);
if (DBA::isResult($user)) {
$self = normalise_link(System::baseUrl() . '/profile/' . $user['nickname']);
$self_id = Contact::getIdForURL($self, 0, true);
Logger::log("'myself' is ".$self_id." for parent ".$parent_id." checking against ".$item['author-id']." and ".$item['owner-id'], LOGGER_DEBUG);
Logger::log("'myself' is ".$self_id." for parent ".$parent_id." checking against ".$item['author-id']." and ".$item['owner-id'], Logger::DEBUG);
if (($item['author-id'] == $self_id) || ($item['owner-id'] == $self_id)) {
DBA::update('thread', ['mention' => true], ['iid' => $parent_id]);
Logger::log("tagged thread ".$parent_id." as mention for user ".$self, LOGGER_DEBUG);
Logger::log("tagged thread ".$parent_id." as mention for user ".$self, Logger::DEBUG);
}
}
} else {
@ -1628,12 +1628,12 @@ class Item extends BaseObject
*/
if ($item["uid"] == 0) {
if (self::exists(['uri' => trim($item['uri']), 'uid' => 0])) {
Logger::log('Global item already stored. URI: '.$item['uri'].' on network '.$item['network'], LOGGER_DEBUG);
Logger::log('Global item already stored. URI: '.$item['uri'].' on network '.$item['network'], Logger::DEBUG);
return 0;
}
}
Logger::log('' . print_r($item,true), LOGGER_DATA);
Logger::log('' . print_r($item,true), Logger::DATA);
if (array_key_exists('tag', $item)) {
$tags = $item['tag'];
@ -1701,7 +1701,7 @@ class Item extends BaseObject
$item = array_merge($item, $delivery_data);
file_put_contents($spool, json_encode($item));
Logger::log("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG);
Logger::log("Item wasn't stored - Item was spooled into file ".$file, Logger::DEBUG);
}
return 0;
}
@ -1760,7 +1760,7 @@ class Item extends BaseObject
*/
if (base64_encode(base64_decode(base64_decode($dsprsig->signature))) == base64_decode($dsprsig->signature)) {
$dsprsig->signature = base64_decode($dsprsig->signature);
Logger::log("Repaired double encoded signature from handle ".$dsprsig->signer, LOGGER_DEBUG);
Logger::log("Repaired double encoded signature from handle ".$dsprsig->signer, Logger::DEBUG);
}
if (!empty($dsprsig->signed_text) && empty($dsprsig->signature) && empty($dsprsig->signer)) {
@ -2145,9 +2145,9 @@ class Item extends BaseObject
$distributed = self::insert($item, false, $notify, true);
if (!$distributed) {
Logger::log("Distributed public item " . $itemid . " for user " . $uid . " wasn't stored", LOGGER_DEBUG);
Logger::log("Distributed public item " . $itemid . " for user " . $uid . " wasn't stored", Logger::DEBUG);
} else {
Logger::log("Distributed public item " . $itemid . " for user " . $uid . " with id " . $distributed, LOGGER_DEBUG);
Logger::log("Distributed public item " . $itemid . " for user " . $uid . " with id " . $distributed, Logger::DEBUG);
}
}
@ -2210,7 +2210,7 @@ class Item extends BaseObject
$public_shadow = self::insert($item, false, false, true);
Logger::log("Stored public shadow for thread ".$itemid." under id ".$public_shadow, LOGGER_DEBUG);
Logger::log("Stored public shadow for thread ".$itemid." under id ".$public_shadow, Logger::DEBUG);
}
}
@ -2267,7 +2267,7 @@ class Item extends BaseObject
$public_shadow = self::insert($item, false, false, true);
Logger::log("Stored public shadow for comment ".$item['uri']." under id ".$public_shadow, LOGGER_DEBUG);
Logger::log("Stored public shadow for comment ".$item['uri']." under id ".$public_shadow, Logger::DEBUG);
// If this was a comment to a Diaspora post we don't get our comment back.
// This means that we have to distribute the comment by ourselves.
@ -2613,29 +2613,29 @@ class Item extends BaseObject
// Prevent the forwarding of posts that are forwarded
if (!empty($datarray["extid"]) && ($datarray["extid"] == Protocol::DFRN)) {
Logger::log('Already forwarded', LOGGER_DEBUG);
Logger::log('Already forwarded', Logger::DEBUG);
return false;
}
// Prevent to forward already forwarded posts
if ($datarray["app"] == $a->getHostName()) {
Logger::log('Already forwarded (second test)', LOGGER_DEBUG);
Logger::log('Already forwarded (second test)', Logger::DEBUG);
return false;
}
// Only forward posts
if ($datarray["verb"] != ACTIVITY_POST) {
Logger::log('No post', LOGGER_DEBUG);
Logger::log('No post', Logger::DEBUG);
return false;
}
if (($contact['network'] != Protocol::FEED) && $datarray['private']) {
Logger::log('Not public', LOGGER_DEBUG);
Logger::log('Not public', Logger::DEBUG);
return false;
}
$datarray2 = $datarray;
Logger::log('remote-self start - Contact '.$contact['url'].' - '.$contact['remote_self'].' Item '.print_r($datarray, true), LOGGER_DEBUG);
Logger::log('remote-self start - Contact '.$contact['url'].' - '.$contact['remote_self'].' Item '.print_r($datarray, true), Logger::DEBUG);
if ($contact['remote_self'] == 2) {
$self = DBA::selectFirst('contact', ['id', 'name', 'url', 'thumb'],
['uid' => $contact['uid'], 'self' => true]);
@ -2675,7 +2675,7 @@ class Item extends BaseObject
if ($contact['network'] != Protocol::FEED) {
// Store the original post
$result = self::insert($datarray2, false, false);
Logger::log('remote-self post original item - Contact '.$contact['url'].' return '.$result.' Item '.print_r($datarray2, true), LOGGER_DEBUG);
Logger::log('remote-self post original item - Contact '.$contact['url'].' return '.$result.' Item '.print_r($datarray2, true), Logger::DEBUG);
} else {
$datarray["app"] = "Feed";
$result = true;
@ -2705,7 +2705,7 @@ class Item extends BaseObject
return $s;
}
Logger::log('check for photos', LOGGER_DEBUG);
Logger::log('check for photos', Logger::DEBUG);
$site = substr(System::baseUrl(), strpos(System::baseUrl(), '://'));
$orig_body = $s;
@ -2719,7 +2719,7 @@ class Item extends BaseObject
$img_st_close++; // make it point to AFTER the closing bracket
$image = substr($orig_body, $img_start + $img_st_close, $img_len);
Logger::log('found photo ' . $image, LOGGER_DEBUG);
Logger::log('found photo ' . $image, Logger::DEBUG);
if (stristr($image, $site . '/photo/')) {
// Only embed locally hosted photos
@ -2761,7 +2761,7 @@ class Item extends BaseObject
// If a custom width and height were specified, apply before embedding
if (preg_match("/\[img\=([0-9]*)x([0-9]*)\]/is", substr($orig_body, $img_start, $img_st_close), $match)) {
Logger::log('scaling photo', LOGGER_DEBUG);
Logger::log('scaling photo', Logger::DEBUG);
$width = intval($match[1]);
$height = intval($match[2]);
@ -2774,9 +2774,9 @@ class Item extends BaseObject
}
}
Logger::log('replacing photo', LOGGER_DEBUG);
Logger::log('replacing photo', Logger::DEBUG);
$image = 'data:' . $type . ';base64,' . base64_encode($data);
Logger::log('replaced: ' . $image, LOGGER_DATA);
Logger::log('replaced: ' . $image, Logger::DATA);
}
}
}
@ -3148,7 +3148,7 @@ class Item extends BaseObject
if (!$onlyshadow) {
$result = DBA::insert('thread', $item);
Logger::log("Add thread for item ".$itemid." - ".print_r($result, true), LOGGER_DEBUG);
Logger::log("Add thread for item ".$itemid." - ".print_r($result, true), Logger::DEBUG);
}
}
@ -3180,26 +3180,26 @@ class Item extends BaseObject
$result = DBA::update('thread', $fields, ['iid' => $itemid]);
Logger::log("Update thread for item ".$itemid." - guid ".$item["guid"]." - ".(int)$result, LOGGER_DEBUG);
Logger::log("Update thread for item ".$itemid." - guid ".$item["guid"]." - ".(int)$result, Logger::DEBUG);
}
private static function deleteThread($itemid, $itemuri = "")
{
$item = DBA::selectFirst('thread', ['uid'], ['iid' => $itemid]);
if (!DBA::isResult($item)) {
Logger::log('No thread found for id '.$itemid, LOGGER_DEBUG);
Logger::log('No thread found for id '.$itemid, Logger::DEBUG);
return;
}
$result = DBA::delete('thread', ['iid' => $itemid], ['cascade' => false]);
Logger::log("deleteThread: Deleted thread for item ".$itemid." - ".print_r($result, true), LOGGER_DEBUG);
Logger::log("deleteThread: Deleted thread for item ".$itemid." - ".print_r($result, true), Logger::DEBUG);
if ($itemuri != "") {
$condition = ["`uri` = ? AND NOT `deleted` AND NOT (`uid` IN (?, 0))", $itemuri, $item["uid"]];
if (!self::exists($condition)) {
DBA::delete('item', ['uri' => $itemuri, 'uid' => 0]);
Logger::log("deleteThread: Deleted shadow for item ".$itemuri, LOGGER_DEBUG);
Logger::log("deleteThread: Deleted shadow for item ".$itemuri, Logger::DEBUG);
}
}
}

View file

@ -107,7 +107,7 @@ class Profile
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
if (!DBA::isResult($user) && empty($profiledata)) {
Logger::log('profile error: ' . $a->query_string, LOGGER_DEBUG);
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
notice(L10n::t('Requested account is not available.') . EOL);
$a->error = 404;
return;
@ -125,7 +125,7 @@ class Profile
$pdata = self::getByNickname($nickname, $user['uid'], $profile);
if (empty($pdata) && empty($profiledata)) {
Logger::log('profile error: ' . $a->query_string, LOGGER_DEBUG);
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
notice(L10n::t('Requested profile is not available.') . EOL);
$a->error = 404;
return;
@ -1021,27 +1021,27 @@ class Profile
// Try to find the public contact entry of the visitor.
$cid = Contact::getIdForURL($my_url);
if (!$cid) {
Logger::log('No contact record found for ' . $my_url, LOGGER_DEBUG);
Logger::log('No contact record found for ' . $my_url, Logger::DEBUG);
return;
}
$contact = DBA::selectFirst('contact',['id', 'url'], ['id' => $cid]);
if (DBA::isResult($contact) && remote_user() && remote_user() == $contact['id']) {
Logger::log('The visitor ' . $my_url . ' is already authenticated', LOGGER_DEBUG);
Logger::log('The visitor ' . $my_url . ' is already authenticated', Logger::DEBUG);
return;
}
// Avoid endless loops
$cachekey = 'zrlInit:' . $my_url;
if (Cache::get($cachekey)) {
Logger::log('URL ' . $my_url . ' already tried to authenticate.', LOGGER_DEBUG);
Logger::log('URL ' . $my_url . ' already tried to authenticate.', Logger::DEBUG);
return;
} else {
Cache::set($cachekey, true, Cache::MINUTE);
}
Logger::log('Not authenticated. Invoking reverse magic-auth for ' . $my_url, LOGGER_DEBUG);
Logger::log('Not authenticated. Invoking reverse magic-auth for ' . $my_url, Logger::DEBUG);
Worker::add(PRIORITY_LOW, 'GProbe', $my_url);
@ -1062,7 +1062,7 @@ class Profile
// We have to check if the remote server does understand /magic without invoking something
$serverret = Network::curl($basepath . '/magic');
if ($serverret->isSuccess()) {
Logger::log('Doing magic auth for visitor ' . $my_url . ' to ' . $magic_path, LOGGER_DEBUG);
Logger::log('Doing magic auth for visitor ' . $my_url . ' to ' . $magic_path, Logger::DEBUG);
System::externalRedirect($magic_path);
}
}
@ -1093,7 +1093,7 @@ class Profile
// Try to find the public contact entry of the visitor.
$cid = Contact::getIdForURL($visitor_handle);
if(!$cid) {
Logger::log('owt: unable to finger ' . $visitor_handle, LOGGER_DEBUG);
Logger::log('owt: unable to finger ' . $visitor_handle, Logger::DEBUG);
return;
}
@ -1122,7 +1122,7 @@ class Profile
info(L10n::t('OpenWebAuth: %1$s welcomes %2$s', $a->getHostName(), $visitor['name']));
Logger::log('OpenWebAuth: auth success from ' . $visitor['addr'], LOGGER_DEBUG);
Logger::log('OpenWebAuth: auth success from ' . $visitor['addr'], Logger::DEBUG);
}
public static function zrl($s, $force = false)

View file

@ -46,7 +46,7 @@ class PushSubscriber
$priority = $default_priority;
}
Logger::log('Publish feed to ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' with priority ' . $priority, LOGGER_DEBUG);
Logger::log('Publish feed to ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' with priority ' . $priority, Logger::DEBUG);
Worker::add($priority, 'PubSubPublish', (int)$subscriber['id']);
}
@ -116,10 +116,10 @@ class PushSubscriber
if ($days > 60) {
DBA::update('push_subscriber', ['push' => -1, 'next_try' => DBA::NULL_DATETIME], ['id' => $id]);
Logger::log('Delivery error: Subscription ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as ended.', LOGGER_DEBUG);
Logger::log('Delivery error: Subscription ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as ended.', Logger::DEBUG);
} else {
DBA::update('push_subscriber', ['push' => 0, 'next_try' => DBA::NULL_DATETIME], ['id' => $id]);
Logger::log('Delivery error: Giving up ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' for now.', LOGGER_DEBUG);
Logger::log('Delivery error: Giving up ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' for now.', Logger::DEBUG);
}
} else {
// Calculate the delay until the next trial
@ -129,7 +129,7 @@ class PushSubscriber
$retrial = $retrial + 1;
DBA::update('push_subscriber', ['push' => $retrial, 'next_try' => $next], ['id' => $id]);
Logger::log('Delivery error: Next try (' . $retrial . ') ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' at ' . $next, LOGGER_DEBUG);
Logger::log('Delivery error: Next try (' . $retrial . ') ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' at ' . $next, Logger::DEBUG);
}
}
@ -149,6 +149,6 @@ class PushSubscriber
// set last_update to the 'created' date of the last item, and reset push=0
$fields = ['push' => 0, 'next_try' => DBA::NULL_DATETIME, 'last_update' => $last_update];
DBA::update('push_subscriber', $fields, ['id' => $id]);
Logger::log('Subscriber ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as vital', LOGGER_DEBUG);
Logger::log('Subscriber ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as vital', Logger::DEBUG);
}
}

View file

@ -471,7 +471,7 @@ class User
$username_max_length = max(1, min(64, intval(Config::get('system', 'username_max_length', 48))));
if ($username_min_length > $username_max_length) {
Logger::log(L10n::t('system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values.', $username_min_length, $username_max_length), LOGGER_WARNING);
Logger::log(L10n::t('system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values.', $username_min_length, $username_max_length), Logger::WARNING);
$tmp = $username_min_length;
$username_min_length = $username_max_length;
$username_max_length = $tmp;