Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition');
DBStructure::performUpdate();
- Logger::log("installed advancedcontentfilter");
+ Logger::notice("installed advancedcontentfilter");
}
/*
$date2 = 0;
}
if (( $date1 <= $now ) && ( $now <= $date2 )) {
- Logger::log('redirecting user to blackout page');
+ Logger::notice('redirecting user to blackout page');
System::externalRedirect($myurl);
}
}
EOT;
- Logger::log('blogger: data: ' . $xml, Logger::DATA);
+ Logger::debug('blogger: data: ' . $xml);
if ($bl_blog !== 'test') {
$x = DI::httpClient()->post($bl_blog, $xml)->getBody();
}
- Logger::log('posted to blogger: ' . (($x) ? $x : ''), Logger::DEBUG);
+ Logger::info('posted to blogger: ' . (($x) ? $x : ''));
}
}
if (!$buffer->ok) {
$o = '<a href="' . $buffer->get_login_url() . '">Connect to Buffer!</a>';
} else {
- Logger::log("buffer_connect: authenticated");
+ Logger::notice("buffer_connect: authenticated");
$o = DI::l10n()->t("You are now authenticated to buffer. ");
$o .= '<br /><a href="' . DI::baseUrl()->get() . '/settings/connectors">' . DI::l10n()->t("return to the connector page") . '</a>';
DI::pConfig()->set(local_user(), 'buffer','access_token', $buffer->access_token);
$profiles = $buffer->go('/profiles');
if (is_array($profiles)) {
- Logger::log("Will send these parameter ".print_r($b, true), Logger::DEBUG);
+ Logger::info("Will send these parameter ".print_r($b, true));
foreach ($profiles as $profile) {
if (!$profile->default)
$item = $b;
$post = Plaintext::getPost($item, $limit, $includedlinks, $htmlmode);
- Logger::log("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), Logger::DEBUG);
+ Logger::info("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true));
// The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures
if (isset($post["image"])) {
}
//print_r($message);
- Logger::log("buffer_send: data for message " . $b["id"] . ": " . print_r($message, true), Logger::DEBUG);
+ Logger::info("buffer_send: data for message " . $b["id"] . ": " . print_r($message, true));
$ret = $buffer->go('/updates/create', $message);
- Logger::log("buffer_send: send message " . $b["id"] . " result: " . print_r($ret, true), Logger::DEBUG);
+ Logger::info("buffer_send: send message " . $b["id"] . " result: " . print_r($ret, true));
}
}
}
Hook::register('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings');
Hook::register('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post');
- Logger::log('registered catavatar');
+ Logger::notice('registered catavatar');
}
/**
{
$hostname = DI::baseUrl()->getHostname();
- Logger::log('diaspora_send: invoked');
+ Logger::notice('diaspora_send: invoked');
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
return;
return;
}
- Logger::log('diaspora_send: prepare posting', Logger::DEBUG);
+ Logger::info('diaspora_send: prepare posting');
$handle = DI::pConfig()->get($b['uid'],'diaspora','handle');
$password = DI::pConfig()->get($b['uid'],'diaspora','password');
$aspect = DI::pConfig()->get($b['uid'],'diaspora','aspect');
if ($handle && $password) {
- Logger::log('diaspora_send: all values seem to be okay', Logger::DEBUG);
+ Logger::info('diaspora_send: all values seem to be okay');
$title = $b['title'];
$body = $b['body'];
require_once "addon/diaspora/diasphp.php";
try {
- Logger::log('diaspora_send: prepare', Logger::DEBUG);
+ Logger::info('diaspora_send: prepare');
$conn = new Diaspora_Connection($handle, $password);
- Logger::log('diaspora_send: try to log in '.$handle, Logger::DEBUG);
+ Logger::info('diaspora_send: try to log in '.$handle);
$conn->logIn();
- Logger::log('diaspora_send: try to send '.$body, Logger::DEBUG);
+ Logger::info('diaspora_send: try to send '.$body);
$conn->provider = $hostname;
$conn->postStatusMessage($body, $aspect);
- Logger::log('diaspora_send: success');
+ Logger::notice('diaspora_send: success');
} catch (Exception $e) {
- Logger::log("diaspora_send: Error submitting the post: " . $e->getMessage());
+ Logger::notice("diaspora_send: Error submitting the post: " . $e->getMessage());
- Logger::log('diaspora_send: requeueing '.$b['uid'], Logger::DEBUG);
+ Logger::info('diaspora_send: requeueing '.$b['uid']);
Worker::defer();
}
Hook::register('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
Hook::register('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
Hook::register('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
- Logger::log("installed fromapp");
+ Logger::notice("installed fromapp");
}
function fromapp_settings_post($a, $post)
$s = DI::httpClient()->fetch("https://api.opencagedata.com/geocode/v1/json?q=" . $coords[0] . "," . $coords[1] . "&key=" . $key . "&language=" . $language);
if (!$s) {
- Logger::log("API could not be queried", Logger::DEBUG);
+ Logger::info("API could not be queried");
return;
}
$data = json_decode($s);
if ($data->status->code != "200") {
- Logger::log("API returned error ".$data->status->code." ".$data->status->message, Logger::DEBUG);
+ Logger::info("API returned error ".$data->status->code." ".$data->status->message);
return;
}
if (($data->total_results == 0) || (count($data->results) == 0)) {
- Logger::log("No results found for coordinates ".$item["coord"], Logger::DEBUG);
+ Logger::info("No results found for coordinates ".$item["coord"]);
return;
}
$item["location"] = $data->results[0]->formatted;
- Logger::log("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], Logger::DEBUG);
+ Logger::info("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"]);
if ($item["location"] != "")
DI::cache()->set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]);
* - The profile owner must have allowed our addon
*/
- Logger::log('geonames invoked');
+ Logger::notice('geonames invoked');
if (!local_user()) { /* non-zero if this is a logged in user of this system */
return;
Hook::register('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Hook::register('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
- Logger::log("installed gnot");
+ Logger::notice("installed gnot");
}
/**
{
Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
- Logger::log("installed googlemaps");
+ Logger::notice("installed googlemaps");
}
function googlemaps_location($a, &$item)
Hook::register('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings');
Hook::register('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
- Logger::log("installed group_text");
+ Logger::notice("installed group_text");
}
/**
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]);
if (!DBA::isResult($user)) {
- Logger::log('User ' . $nickname . ' not found.', Logger::DEBUG);
+ Logger::info('User ' . $nickname . ' not found.');
return;
}
$uid = $user['uid'];
- Logger::log('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true), Logger::DEBUG);
+ Logger::info('Received a post for user ' . $uid . ' from ifttt ' . print_r($_REQUEST, true));
if (!isset($_REQUEST['key'])) {
- Logger::log('No key found.');
+ Logger::notice('No key found.');
return;
}
// Check the key
if ($key != DI::pConfig()->get($uid, 'ifttt', 'key')) {
- Logger::log('Invalid key for user ' . $uid, Logger::DEBUG);
+ Logger::info('Invalid key for user ' . $uid);
return;
}
}
if (!in_array($item['type'], ['status', 'link', 'photo'])) {
- Logger::log('Unknown item type ' . $item['type'], Logger::DEBUG);
+ Logger::info('Unknown item type ' . $item['type']);
return;
}
Hook::register('load_config', 'addon/impressum/impressum.php', 'impressum_load_config');
Hook::register('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
Hook::register('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
- Logger::log("installed impressum Addon");
+ Logger::notice("installed impressum Addon");
}
function impressum_module() {
$js_upload_jsonresponse = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
if (isset($result['error'])) {
- Logger::log('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'], Logger::DEBUG);
+ Logger::info('mod/photos.php: photos_post(): error uploading photo: ' . $result['error']);
echo json_encode($result);
exit();
}
{
global $js_upload_jsonresponse;
- Logger::log('upload_post_end');
+ Logger::notice('upload_post_end');
if (!empty($js_upload_jsonresponse)) {
echo $js_upload_jsonresponse;
exit();
Hook::register('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
Hook::register('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
- Logger::log("installed krynn");
+ Logger::notice("installed krynn");
}
function krynn_post_hook($a, &$item) {
if($last) {
$next = $last + 86400;
if($next > time()) {
- Logger::log('poll intervall not reached');
+ Logger::notice('poll intervall not reached');
return;
}
}
function libertree_send(&$a,&$b) {
- Logger::log('libertree_send: invoked');
+ Logger::notice('libertree_send: invoked');
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
return;
];
$result = DI::httpClient()->post($ltree_blog, $params)->getBody();
- Logger::log('libertree: ' . $result);
+ Logger::notice('libertree: ' . $result);
}
}
function newmemberwidget_install()
{
Hook::register( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
- Logger::log('newmemberwidget installed');
+ Logger::notice('newmemberwidget installed');
}
function newmemberwidget_network_mod_init ($a, $b)
Hook::register('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
Hook::register('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
- Logger::log("installed numfriends");
+ Logger::notice("installed numfriends");
}
/**
Hook::register('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates');
Hook::register('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader');
- Logger::log("installed openstreetmap");
+ Logger::notice("installed openstreetmap");
}
function openstreetmap_load_config(\Friendica\App $a, ConfigFileLoader $loader)
$lat = $b['lat']; // round($b['lat'], 5);
$lon = $b['lon']; // round($b['lon'], 5);
- Logger::log('lat: ' . $lat, Logger::DATA);
- Logger::log('lon: ' . $lon, Logger::DATA);
+ Logger::debug('lat: ' . $lat);
+ Logger::debug('lon: ' . $lon);
$cardlink = '<a href="' . $tmsserver;
$b['html'] .= '<br/>' . $cardlink;
}
- Logger::log('generate_map: ' . $b['html'], Logger::DATA);
+ Logger::debug('generate_map: ' . $b['html']);
}
function openstreetmap_addon_admin(&$a, &$o)
{
Hook::register('addon_settings', __FILE__, 'opmlexport_addon_settings');
Hook::register('addon_settings_post', __FILE__, 'opmlexport_addon_settings_post');
- Logger::log('installed opmlexport Addon');
+ Logger::notice('installed opmlexport Addon');
}
Hook::register('load_config', 'addon/piwik/piwik.php', 'piwik_load_config');
Hook::register('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
- Logger::log("installed piwik addon");
+ Logger::notice("installed piwik addon");
}
function piwik_load_config(\Friendica\App $a, ConfigFileLoader $loader)
Hook::register('addon_settings', 'addon/planets/planets.php', 'planets_settings');
Hook::register('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
- Logger::log("installed planets");
+ Logger::notice("installed planets");
}
function planets_post_hook($a, &$item) {
*
*/
- Logger::log('planets invoked');
+ Logger::notice('planets invoked');
if(! local_user()) /* non-zero if this is a logged in user of this system */
return;
function public_server_cron($a, $b)
{
- Logger::log("public_server: cron start");
+ Logger::notice("public_server: cron start");
$users = DBA::selectToArray('user', [], ["`account_expires_on` < UTC_TIMESTAMP() + INTERVAL ? DAY AND
`account_expires_on` > ? AND `expire_notification_sent` <= ?", 5, DBA::NULL_DATETIME, DBA::NULL_DATETIME]);
}
}
- Logger::log("public_server: cron end");
+ Logger::notice("public_server: cron end");
}
function public_server_enotify(&$a, &$b)
if (function_exists('sys_getloadavg')) {
$load = sys_getloadavg();
if (intval($load[0]) > DI::config()->get('system', 'maxloadavg', 50)) {
- Logger::log('system: load ' . $load[0] . ' too high. Pumpio sync deferred to next scheduled run.');
+ Logger::notice('system: load ' . $load[0] . ' too high. Pumpio sync deferred to next scheduled run.');
return;
}
}
Hook::register('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings');
Hook::register('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
- Logger::log("installed randplace");
+ Logger::notice("installed randplace");
}
*
*/
- Logger::log("removed randplace");
+ Logger::notice("removed randplace");
}
*
*/
- Logger::log('randplace invoked');
+ Logger::notice('randplace invoked');
if(! local_user()) /* non-zero if this is a logged in user of this system */
return;
Hook::register('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare', 10);
- Logger::log('installed securemail');
+ Logger::notice('installed securemail');
}
/**
//print_r($params);
if ($ret_code == 201) {
- Logger::log('tumblr_send: success');
+ Logger::notice('tumblr_send: success');
} elseif ($ret_code == 403) {
- Logger::log('tumblr_send: authentication failure');
+ Logger::notice('tumblr_send: authentication failure');
} else {
- Logger::log('tumblr_send: general error: ' . print_r($x,true));
+ Logger::notice('tumblr_send: general error', ['error' => $x]);
}
}
}
}
}
DI::pConfig()->set($uid, 'twitter', 'lastid', $lastid);
- Logger::log('Last ID for user ' . $uid . ' is now ' . $lastid, Logger::DEBUG);
+ Logger::info('Last ID for user ' . $uid . ' is now ' . $lastid);
}
function twitter_fix_avatar($avatar)
$posts[] = $post;
}
- Logger::log("twitter_fetchparentposts: Fetching " . count($posts) . " parents", Logger::DEBUG);
+ Logger::info("twitter_fetchparentposts: Fetching " . count($posts) . " parents");
$posts = array_reverse($posts);
$postarray["id"] = $item;
- Logger::log('twitter_fetchparentpost: User ' . $self["nick"] . ' posted parent timeline item ' . $item);
+ Logger::notice('twitter_fetchparentpost: User ' . $self["nick"] . ' posted parent timeline item ' . $item);
}
}
}
twitter_fetchparentposts($a, $uid, $post, $connection, $self);
}
- Logger::log('Preparing post ' . $post->id_str . ' for user ' . $uid, Logger::DEBUG);
+ Logger::info('Preparing post ' . $post->id_str . ' for user ' . $uid);
$postarray = twitter_createpost($a, $uid, $post, $self, $create_user, true, false);
if (empty($postarray['body']) || trim($postarray['body']) == "") {
- Logger::log('Empty body for post ' . $post->id_str . ' and user ' . $uid, Logger::DEBUG);
+ Logger::info('Empty body for post ' . $post->id_str . ' and user ' . $uid);
continue;
}
$item = Item::insert($postarray, $notify);
$postarray["id"] = $item;
- Logger::log('User ' . $uid . ' posted home timeline item ' . $item);
+ Logger::notice('User ' . $uid . ' posted home timeline item ' . $item);
}
}
DI::pConfig()->set($uid, 'twitter', 'lasthometimelineid', $lastid);
- Logger::log('Last timeline ID for user ' . $uid . ' is now ' . $lastid, Logger::DEBUG);
+ Logger::info('Last timeline ID for user ' . $uid . ' is now ' . $lastid);
// Fetching mentions
$lastid = DI::pConfig()->get($uid, 'twitter', 'lastmentionid');
$posts = array_reverse($items);
- Logger::log("Fetching mentions for user " . $uid . " " . sizeof($posts) . " items", Logger::DEBUG);
+ Logger::info("Fetching mentions for user " . $uid . " " . sizeof($posts) . " items");
if (count($posts)) {
foreach ($posts as $post) {
$item = Item::insert($postarray);
- Logger::log('User ' . $uid . ' posted mention timeline item ' . $item);
+ Logger::notice('User ' . $uid . ' posted mention timeline item ' . $item);
}
}
DI::pConfig()->set($uid, 'twitter', 'lastmentionid', $lastid);
- Logger::log('Last mentions ID for user ' . $uid . ' is now ' . $lastid, Logger::DEBUG);
+ Logger::info('Last mentions ID for user ' . $uid . ' is now ' . $lastid);
}
function twitter_fetch_own_contact(App $a, $uid)
EOT;
- Logger::log('wppost: data: ' . $xml, Logger::DATA);
+ Logger::debug('wppost: data: ' . $xml);
if ($wp_blog !== 'test') {
$x = DI::httpClient()->post($wp_blog, $xml)->getBody();
}
- Logger::log('posted to wordpress: ' . (($x) ? $x : ''), Logger::DEBUG);
+ Logger::info('posted to wordpress: ' . (($x) ? $x : ''));
}
}