We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
How to introspect Elixir modules at runtime
259
clicks
Source: elixirstreams.com
In Elixir, there is sometimes a need to introspect information about compiled modules during runtime—a task that is not primarily served by the `Module` module, which focuses on compilation time concerns. To address this need, Elixir offers the `__info__/1` function within the `Module` module. This function accepts a single argument and returns various pieces of runtime information such as attributes, compiler metadata, public functions and macros (along with their arities), MD5 checksum of the module, the module's atom name, and defined struct fields. This functionality provides developers with introspective capabilities that can be utilized for debugging, logging, or metaprogramming purposes in live, running applications.
Related posts
© HashMerge 2025