Reputation: 45
I have a problem with working with the automatic logging using @Debug
metadata.
I'm receiving following error:
TypeError: Cannot read property 'debug' of null
- Which after some digging into generated code indicates that the logger is null.
This is my setup:
class SomeView implements ISomeView implements IsLoggable implements IInjectorContainer
{
var _view:Component;
public function new()
{
}
@Debug public function showNumber(number:Float):Void
{
//trace('number is: $number');
}
}
In DSL I have this:
<view id="someView" type="my.views.SomeView />
<config id="someViewConfig" type="hex.ioc.di.MappingConfiguration" >
<item map-name="normal" inject-into="true">
<key type="Class" value="my.views.ISomeView"/>
<value ref="someView"/>
</item>
</config>
As far as I understand this should make sure that I have the logger injected.
I've also tried calling _injector.injectInto(_myView);
in my module which is also not solving the problem.
Anyone knows how to enable the automatic debug calls?
Upvotes: 1
Views: 55
Reputation: 268
I opened an issue here. "It's related to interfaces implementation order. When IInjectorContainer (building macro) is executed before IsLoggable one, logger property is not added to refection data and cannot be injected later." Thanks for your feedback.
Upvotes: 2