That is not exactly true. The main reason why you need require or import (use is just wrapper over require) is that you need to compile module with macro definition to happen before your module will be compiled, otherwise the compiler do not know what macro should expand to. The reason why it cannot be done automatically is that there is no way to know whether given construct is a macro or just regular function without first compiling the another module. Theoretically it shouldn’t be required for Logger, as this module is almost always already compiled when you compile your project, but for sake of the consistency it is better to have it there.
Suppose you want to use Logger all over your application (which I think makes sense but not sure how others do it). Does this mean you have to require Logger at the top of each file? Is there some way to modify the AppWeb config so that Logger is always included and I don’t have to worry about this anymore?
I tried adding it into “view_helpers” macro but it didn’t work. I also tried adding it into the app_web.ex file alone but that didn’t work either. Frankly, I’m not well versed on macro development or how this part of the infrastructure works, so probably missing something, but i you have thoughts as to how to set this up or best practices advice for what you normally do, would be appreciated. For now, I’ll just require logger everywhere…