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

View file

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

View file

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

View file

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