Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7ae584bc
Commit
7ae584bc
authored
Jun 03, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle 'last message repeated' from ios simulator (#4300)
parent
8171aa86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+22
-13
No files found.
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
7ae584bc
...
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'dart:math'
as
math
;
import
'package:path/path.dart'
as
path
;
...
...
@@ -700,7 +701,6 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
final
IOSSimulator
device
;
StreamController
<
String
>
_linesController
;
bool
_lastWasFiltered
=
false
;
// We log from two files: the device and the system log.
Process
_deviceProcess
;
...
...
@@ -736,15 +736,14 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
static
final
RegExp
_mapRegex
=
new
RegExp
(
r'\S+ +\S+ +\S+ \S+ (.+)\[\d+\]\)?: (.*)$'
);
// Jan 31 19:23:28 --- last message repeated 1 time ---
static
final
RegExp
_lastMessageRegex
=
new
RegExp
(
r'\S+ +\S+ +\S+ --- (.*) ---$'
);
static
final
RegExp
_lastMessageSingleRegex
=
new
RegExp
(
r'\S+ +\S+ +\S+ --- last message repeated 1 time ---$'
);
static
final
RegExp
_lastMessageMultipleRegex
=
new
RegExp
(
r'\S+ +\S+ +\S+ --- last message repeated (\d+) times ---$'
);
static
final
RegExp
_flutterRunnerRegex
=
new
RegExp
(
r' FlutterRunner\[\d+\] '
);
String
_filterDeviceLine
(
String
string
)
{
Match
match
=
_mapRegex
.
matchAsPrefix
(
string
);
if
(
match
!=
null
)
{
_lastWasFiltered
=
true
;
// Filter out some messages that clearly aren't related to Flutter.
if
(
string
.
contains
(
': could not find icon for representation -> com.apple.'
))
return
null
;
...
...
@@ -762,23 +761,33 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
&&
content
.
endsWith
(
']: 0x1'
))
return
null
;
_lastWasFiltered
=
false
;
if
(
category
==
'Runner'
)
return
content
;
return
'
$category
:
$content
'
;
}
match
=
_lastMessageRegex
.
matchAsPrefix
(
string
);
if
(
match
!=
null
&&
!
_lastWasFiltered
)
return
'(
${match.group(1)}
)'
;
match
=
_lastMessage
Single
Regex
.
matchAsPrefix
(
string
);
if
(
match
!=
null
)
return
null
;
return
string
;
}
String
_lastLine
;
void
_onDeviceLine
(
String
line
)
{
String
filteredLine
=
_filterDeviceLine
(
line
);
if
(
filteredLine
==
null
)
return
;
_linesController
.
add
(
filteredLine
);
Match
multi
=
_lastMessageMultipleRegex
.
matchAsPrefix
(
line
);
if
(
multi
!=
null
)
{
if
(
_lastLine
!=
null
)
{
int
repeat
=
int
.
parse
(
multi
.
group
(
1
));
repeat
=
math
.
max
(
0
,
math
.
min
(
100
,
repeat
));
for
(
int
i
=
0
;
i
<
repeat
;
i
++)
_linesController
.
add
(
_lastLine
);
}
}
else
{
_lastLine
=
_filterDeviceLine
(
line
);
if
(
_lastLine
!=
null
)
_linesController
.
add
(
_lastLine
);
}
}
String
_filterSystemLog
(
String
string
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment