View Source Ecto.DevLogger (ecto_dev_logger v0.10.0)
An alternative logger for Ecto queries.
It inlines bindings into the query, so it is easy to copy-paste logged SQL and run it in any IDE for debugging without manual transformation of common elixir terms to string representation (binary UUID, DateTime, Decimal, json, etc). Also, it highlights db time to make slow queries noticeable. Source table and inlined bindings are highlighted as well.
Link to this section Summary
Functions
Gets the handler_id for a given Repo.
Attaches telemetry_handler/4
to application.
Telemetry handler which logs queries.
Detaches a previously attached handler for a given Repo.
Link to this section Types
Link to this section Functions
Gets the handler_id for a given Repo.
Attaches telemetry_handler/4
to application.
Returns the result from the call to :telemetry.attach/4
or :ok
if the repo has default logging enabled.
options
Options
:log_repo_name
- when truthy will add the repo name into the log.:ignore_event
- a callback which allows to skip some telemetry events thus skip printing logs. By default, the library ignores events fromOban
and events related to migration queries. These checks are not overridable by:ignore_event
callback and have priority over it.
@spec telemetry_handler( :telemetry.event_name(), :telemetry.event_measurements(), :telemetry.event_metadata(), [option()] ) :: :ok
Telemetry handler which logs queries.
@spec uninstall(repo_module :: module()) :: :ok | {:error, :not_found}
Detaches a previously attached handler for a given Repo.
Returns the result from the call to :telemetry.detach/1