Function overriding at compile time

If it’s for logging calls or computing statistics, you could use the standard tracing tools in Erlang’s dbg module.