ApifyClient.Logs (apify_client v1.0.0)

Copy Markdown View Source

Logs of Actor runs and builds.

{:ok, log} = ApifyClient.Logs.get(run.id)

# Follow a running Actor's log
{:ok, stream} = ApifyClient.Logs.stream(run.id)
Enum.each(stream, &IO.write/1)

Functions take the connection options described in ApifyClient.Client (:token, :config, ...) next to their own.

Summary

Functions

Gets the log of a run or build as text.

Streams the log of a run or build as binary chunks, for as long as it is running.

Functions

get(build_or_run_id, opts \\ [])

@spec get(String.t(), keyword()) ::
  {:ok, String.t()} | {:error, ApifyClient.Error.t()}

Gets the log of a run or build as text.

Options

  • :raw - keep the log verbatim (by default the API removes ANSI escape codes)

stream(build_or_run_id, opts \\ [])

@spec stream(String.t(), keyword()) ::
  {:ok, Enumerable.t()} | {:error, ApifyClient.Error.t()}

Streams the log of a run or build as binary chunks, for as long as it is running.

The request is made right away, so a missing run comes back as an error. The returned stream must be consumed by the calling process (the chunks arrive in its mailbox).

Options

  • :raw - keep the log verbatim (by default the API removes ANSI escape codes)