code: def retrieve_logs(self, include_lambda_messages=True, max_entries=None):
          # type: (bool, Optional[int]) -> Iterator[Dict[str, Any]]
          
          # TODO: Add support for startTime/endTime.
          shown = 0
          for event in self._client.iter_log_events(self._log_group_name,
                                                    interleaved=True):
              if not include_lambda_messages and \
                      self._is_lambda_message(event):
                  continue
              # logStreamName is: '2016/07/05/[id]hash'
              # We want to extract the hash portion and
              # provide a short identifier.
              identifier = event['logStreamName']
              if ']' in identifier:
                  index = identifier.find(']')
                  identifier = identifier[index + 1:index + 7]
              event['logShortId'] = identifier
              yield event
              shown += 1
              if max_entries is not None and shown >= max_entries:
                  return
docs: Retrieve logs from a log group.
  
          :type include_lambda_messages: boolean
          :param include_lambda_messages: Include logs generated by the AWS
              Lambda service.  If this value is False, only chalice logs will be
              included.
  
          :type max_entries: int
          :param max_entries: Maximum number of log messages to include.
  
          :rtype: iterator
          :return: An iterator that yields event dicts.  Each event
              dict has these keys:
  
              * logStreamName -> (string) The name of the log stream.
              * timestamp -> (datetime.datetime) - The timestamp for the msg.
              * message -> (string) The data contained in the log event.
              * ingestionTime -> (datetime.datetime) Ingestion time of event.
              * eventId -> (string) A unique identifier for this event.
              * logShortId -> (string) Short identifier for logStreamName.