Debugging generated code

Copy Markdown View Source

Enable generator diagnostics in the application configuration used while compiling the facade:

config :maxo_adapt, debug: true

MaxoAdapt then prints inspected generated AST and its formatted Elixir representation. Keep this disabled in routine development and CI because output can be large for behaviours with many callbacks.

At runtime, inspect the effective implementation directly:

MyApp.SessionRepo.__maxo_adapt__()
#=> MyApp.SessionRepo.PostgreSQL

Mutable configuration logs use the facade's :log option (:debug by default). Set log: false when configuration is expected and should remain silent, especially in tests and benchmarks.

When configuration validation fails, MaxoAdapt returns {:error, :invalid_adapter_implementation} and logs whether the module was missing or which required name/arity pairs were absent. The previous adapter remains active.