@@ -1579,33 +1579,6 @@ async def get_tags(self, *, client: _Client | None = None) -> dict[str, str]:
15791579 resp = await client .stub .AppGetTags (req )
15801580 return dict (resp .tags )
15811581
1582- async def _logs (self , client : _Client | None = None ) -> AsyncGenerator [str , None ]:
1583- """Stream logs from the app.
1584-
1585- This method is considered private and its interface may change - use at your own risk!
1586- """
1587- if not self ._app_id :
1588- raise InvalidError ("`app._logs` requires a running/stopped app." )
1589-
1590- client = client or self ._client or await _Client .from_env ()
1591-
1592- last_log_batch_entry_id : str | None = None
1593- while True :
1594- request = api_pb2 .AppGetLogsRequest (
1595- app_id = self ._app_id ,
1596- timeout = 55 ,
1597- last_entry_id = last_log_batch_entry_id ,
1598- )
1599- async for log_batch in client .stub .AppGetLogs .unary_stream (request ):
1600- if log_batch .entry_id :
1601- # log_batch entry_id is empty for fd="server" messages from AppGetLogs
1602- last_log_batch_entry_id = log_batch .entry_id
1603- if log_batch .app_done :
1604- return
1605- for log in log_batch .items :
1606- if log .data :
1607- yield log .data
1608-
16091582 @classmethod
16101583 def _get_container_app (cls ) -> "_App | None" :
16111584 """Returns the `App` running inside a container.
@@ -1621,7 +1594,7 @@ def _reset_container_app(cls):
16211594 async def _get_log_query_data (self ) -> _LogQueryData :
16221595 """Get the data needed to query logs for this app."""
16231596 if not self ._app_id :
1624- raise InvalidError ("`app._logs ` requires a running/stopped app." )
1597+ raise InvalidError ("`app.logs ` requires a running/stopped app." )
16251598 client = self ._client or await _Client .from_env ()
16261599 filters = LogsFilters ()
16271600 return _LogQueryData (client = client , app_id = self ._app_id , filters = filters , source_object_id = self ._app_id )
0 commit comments