Skip to content

Conversation

@thenewguy39
Copy link

Description of changes:
Lambda accepts multi-line messages where the timestamp of the log emission is encoded in the log event header. This helps ordering the function emitted messages with regards to platform emitted messages, e.g. START, REPORT.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@luben
Copy link

luben commented Jan 18, 2023

LGTM

"testrequestId",
)
bootstrap.log_error(err_to_log, log_sink)
after = int(time.time_ns() / 1000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: adding randomness into unit tests is discouraged. In this particular case it should not cause losing determinism, so it's fine to leave if here

def log(self, msg):
encoded_msg = msg.encode("utf8")
log_msg = self.frame_type + len(encoded_msg).to_bytes(4, "big") + encoded_msg
timestamp = int(time.time_ns() / 1000) # UNIX timestamp in microseconds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using // should be a cleaner way to show that it's not a type conversion

@briensea briensea merged commit 97dee25 into aws:main Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants