Fix code formatting

This commit is contained in:
fabrixxm 2021-05-24 22:05:02 +02:00
parent 5b9aeeeca9
commit 84fa668845
4 changed files with 102 additions and 99 deletions

View File

@ -18,11 +18,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Model\Log;
use \Friendica\Util\ReversedFileReader;
use \Friendica\Object\Log\ParsedLog;
use Friendica\Util\ReversedFileReader;
use Friendica\Object\Log\ParsedLog;
/**
* An iterator which returns `\Friendica\Objec\Log\ParsedLog` instances
@ -98,7 +98,7 @@ class ParsedLogIterator implements \Iterator
if ($this->search != "") {
return strstr($parsedlog->logline, $this->search) !== false;
}
return True;
return true;
}
/**
@ -153,6 +153,4 @@ class ParsedLogIterator implements \Iterator
{
return ! is_null($this->value);
}
}

View File

@ -43,8 +43,8 @@ class View extends BaseAdmin
$data = null;
$error = null;
$search = $_GET['q'] ?? '';
$filters_valid_values = [
'level' => [
'',

View File

@ -18,6 +18,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Object\Log;
/**
@ -64,12 +65,16 @@ class ParsedLog
private function parse($logline)
{
list($logline, $jsonsource) = explode(' - ', $logline);
$jsondata = null;
if (strpos($logline, '{"') > 0) {
list($logline, $jsondata) = explode('{"', $logline, 2);
$jsondata = '{"' . $jsondata;
}
preg_match(self::REGEXP, $logline, $matches);
$this->date = $matches[1];
$this->context = $matches[2];
$this->level = $matches[3];
@ -112,12 +117,12 @@ class ParsedLog
*
* @return array
*/
public function get_data() {
public function get_data()
{
$data = json_decode($this->data, true);
if ($data) {
foreach ($data as $k => $v) {
$v = print_r($v, true);
$data[$k] = $v;
$data[$k] = print_r($v, true);
}
}
return $data;
@ -128,7 +133,8 @@ class ParsedLog
*
* @return array
*/
public function get_source() {
public function get_source()
{
return json_decode($this->source, true);
}
}

View File

@ -21,7 +21,6 @@
namespace Friendica\Util;
/**
* An iterator which returns lines from file in reversed order
*