Ecto v1.1.0 Ecto.LogEntry

Summary

Functions

Struct used for logging entries

Resolves a log entry

Converts a log entry into iodata

Types

t :: %Ecto.LogEntry{connection_pid: pid | nil, params: [term], query: iodata | (t -> iodata), query_time: integer, queue_time: integer, result: {:ok, term} | {:error, Exception.t}}

Functions

__struct__()

Struct used for logging entries.

It is composed of the following fields:

  • query - the query as iodata or a function that when invoked resolves to iodata;
  • params - the query parameters;
  • result - the query result as an :ok or :error tuple;
  • query_time - the time spent executing the query in microseconds;
  • queue_time - the time spent to check the connection out in microseconds (it may be nil);
  • connection_pid - the connection process that executed the query
resolve(entry)

Resolves a log entry.

In case the query is represented by a function for lazy computation, this function resolves it into iodata.

to_iodata(entry)

Converts a log entry into iodata.

The entry is automatically resolved if it hasn’t been yet.