pub struct LogClient { /* private fields */ }Expand description
Client for an Actor run or build log.
Implementations§
Source§impl LogClient
impl LogClient
Sourcepub async fn get(&self) -> ApifyClientResult<Option<String>>
pub async fn get(&self) -> ApifyClientResult<Option<String>>
Fetches the entire log as a string, or None if it does not exist.
Uses the default (processed) log format. To request the raw log, use
LogClient::get_with_options.
Sourcepub async fn get_with_options(
&self,
options: LogOptions,
) -> ApifyClientResult<Option<String>>
pub async fn get_with_options( &self, options: LogOptions, ) -> ApifyClientResult<Option<String>>
Fetches the entire log as a string, or None if it does not exist, applying the given
LogOptions (e.g. LogOptions::raw).
Sourcepub async fn stream(
&self,
) -> ApifyClientResult<impl Stream<Item = ApifyClientResult<Vec<u8>>>>
pub async fn stream( &self, ) -> ApifyClientResult<impl Stream<Item = ApifyClientResult<Vec<u8>>>>
Opens a streaming connection to the log, yielding chunks of bytes as they arrive.
This powers real-time log redirection: callers can forward each chunk to their own logger/stdout while a run is still in progress. The stream completes when the log ends (i.e. the run finishes).
Uses the default (processed) log format. To stream the raw log, use
LogClient::stream_with_options.
Sourcepub async fn stream_with_options(
&self,
options: LogOptions,
) -> ApifyClientResult<impl Stream<Item = ApifyClientResult<Vec<u8>>>>
pub async fn stream_with_options( &self, options: LogOptions, ) -> ApifyClientResult<impl Stream<Item = ApifyClientResult<Vec<u8>>>>
Opens a streaming connection to the log applying the given LogOptions, yielding
chunks of bytes as they arrive.
Like LogClient::stream, but lets the caller request the raw log via
LogOptions::raw (as the reference client’s log redirection does, which streams
{ raw: true }).