-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logcat fixes #250
Logcat fixes #250
Conversation
uplink/src/collector/logcat.rs
Outdated
@@ -133,14 +134,18 @@ impl LogEntry { | |||
} | |||
|
|||
pub fn to_payload(&self, sequence: u32) -> anyhow::Result<Payload> { | |||
let payload = serde_json::to_value(self)?; | |||
|
|||
Ok(Payload { | |||
stream: "logs".to_string(), | |||
device_id: None, | |||
sequence, | |||
timestamp: self.timestamp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be log's timestamp if available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If logs are expected to have timestamps, can we treat timestamp errors as failures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only read real time logcat output so the two timestamps will always be very close.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logcat line regex specifies time field as mandatory so if timestamp isn't there the regex match will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flush timeouts are working for logs stream now so the logs issue reactlabs saw shouldn't happen.
uplink/src/collector/logcat.rs
Outdated
|
||
fn read_line_lossy(reader: &mut BufReader<ChildStdout>) -> Option<String> { | ||
let mut buf = Vec::with_capacity(256); | ||
if let Err(_) = reader.read_until(u8::try_from('\n').unwrap(), &mut buf) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Change to
reader.read_until(b'\n', &mut buf)
? - Change
Option
toResult
and break with error log
Closes #
Changes
Remove duplicate timestamps in logcat
Handle encoding errors properly in logcat output
@tekjar Doesn't include debugging changes in react-stability
Why?
Trials Performed