Parses a single log entry emitted by app_logging.AppLogsHandler.
Parses a log entry of the form LOG <level> <timestamp> <message> where the level is in the range [0, 4]. If the entry is not of that form, take the whole entry to be the message. Null characters in the entry are replaced by newlines.
Parametersentry – The log entry to parse.
ReturnsA (timestamp, level, message, source_location) tuple.
Parses a str containing newline separated log entries.
Parses a series of log entries in the form LOG <level> <timestamp> <message> where the level is in the range [0, 4]. Null characters in the entry are replaced by newlines.
Parameterslogs – A string containing the log entries.
ReturnsA list of (timestamp, level, message, source_location) tuples.
Create the correct type of record based on what the line looks like.
With the classic streaming API, we did not distinguish between a message that came through the logging infrastructure and one that came through stderr or logservice.write but had been written to look like it came from logging.
Note that this code does not provide 100% accuracy with the old stream service. In the past, they could have written:
sys.stderr.write(‘LOG %d %d’ % (level, time)) sys.stderr.write(‘ %s’ % message)
and that would have magically turned into a single full record. Trying to handle every single corner case seems like a poor use of time.
Parametersline – a single line written to stderr or logservice.write.
ReturnsThe appropriate type of record.
Returns the ID of the current request assigned by App Engine.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-04-04 UTC.