Great article. I was looking for this kind of example.
I had only one issue with re-exporting the dynamic LoggerModule.
The prefixesForLoggers was not call in time (same issues as you explained in the article) due to other modules loading.
In my case I have a CoreModule that includes many base modules and services.
I was able to overcome the issue by making the LoggerModule an Asyc module (using Promise and setTimeout(..., 0)). This let all the files and @Logger(...) to be called and add all the prefixes to prefixesForLoggers array before resolving.
Great article. I was looking for this kind of example.
I had only one issue with re-exporting the dynamic LoggerModule.
The
prefixesForLoggers
was not call in time (same issues as you explained in the article) due to other modules loading.In my case I have a
CoreModule
that includes many base modules and services.I was able to overcome the issue by making the LoggerModule an Asyc module (using
Promise
andsetTimeout(..., 0)
). This let all the files and@Logger(...)
to be called and add all the prefixes toprefixesForLoggers
array before resolving.Thanks :)