mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-07 18:04:26 +02:00
Logger Levels
update logger levels
This commit is contained in:
parent
49eff56e5d
commit
c9a8974165
17 changed files with 123 additions and 123 deletions
|
@ -55,25 +55,25 @@ function geocoordinates_resolve_item(&$item)
|
|||
$s = Network::fetchUrl("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::log("API could not be queried", Logger::DEBUG);
|
||||
return;
|
||||
}
|
||||
|
||||
$data = json_decode($s);
|
||||
|
||||
if ($data->status->code != "200") {
|
||||
Logger::log("API returned error ".$data->status->code." ".$data->status->message, LOGGER_DEBUG);
|
||||
Logger::log("API returned error ".$data->status->code." ".$data->status->message, Logger::DEBUG);
|
||||
return;
|
||||
}
|
||||
|
||||
if (($data->total_results == 0) || (count($data->results) == 0)) {
|
||||
Logger::log("No results found for coordinates ".$item["coord"], LOGGER_DEBUG);
|
||||
Logger::log("No results found for coordinates ".$item["coord"], Logger::DEBUG);
|
||||
return;
|
||||
}
|
||||
|
||||
$item["location"] = $data->results[0]->formatted;
|
||||
|
||||
Logger::log("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], LOGGER_DEBUG);
|
||||
Logger::log("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], Logger::DEBUG);
|
||||
|
||||
if ($item["location"] != "")
|
||||
Cache::set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue