Skip to content

Commit

Permalink
LogController: Split log lines correctly
Browse files Browse the repository at this point in the history
Doesn't enforce a specific set of characters
for type identifiers anymore now.

fixes #5
  • Loading branch information
Johannes Meyer committed Apr 30, 2019
1 parent 072d32a commit 0183121
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions application/controllers/LogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public function indexAction()

$resource = new FileReader(new ConfigObject([
'filename' => $file,
'fields' => '/(?<!.)(?<datetime>[0-9]{4}(?:-[0-9]{2}){2}' // date
'fields' => '/(?<!.)' // ^ can't handle multilines, don't ask *me* why this works
. '(?<datetime>[0-9]{4}(?:-[0-9]{2}){2}' // date
. 'T[0-9]{2}(?::[0-9]{2}){2}(?:[\+\-][0-9]{2}:[0-9]{2})?)' // time
. ' - (?<identity>.*)' // identity
. ' - (?<type>[A-Za-z]+)' // type
. ' - (?<message>.*)(?!.)/msS' // message
. ' - (?<identity>.+)' // identity
. ' - (?<type>.+)' // type
. ' - (?<message>.+)' // message
. '(?!.)/msSU' // $ can't handle multilines, don't ...
]));

$this->view->logData = $resource->select()->order('DESC');
Expand Down

0 comments on commit 0183121

Please sign in to comment.