ColdBox 2.6.2 autowire debugMode logging

Sorry Luis, I’ve been saving up some questions, so I finally got a chance to unleash them today. :slight_smile:

As soon as we started using CB 2.6.2 to autowire our model into our handers etc (cfproperty type=model), we noticed the debugMode property in the autowire interceptor didn’t seem to work entirely. It would turn off some of the debugging that went into our log file, but we were still getting a lot of autowire debugging being logged even when it was set to false.

If we back up a few steps and start in the processAutoWire method in the autowire interceptor, it takes the debugmode setting from the interceptor config and passes it into the autowire method in beanFactory. This is good so far.

Line 422 of beanFactory.autowire() goes to look up the dependencies for my dependencies (dizzy yet?) by calling getDSLDependency. In my particular case, that skips me to getModelDSL which passes me on to getModel with ONLY the name parameter (the original debugMode setting has long since been left behind). getModel defaults debugMode to true, and then proceeds to call autowire again on line 192 passing in true for the debugMode. (I’ve got several layers of dependencies in my models so it recourses a few layers down)

Now I have made it full circle back to the autowire method in beanFactory, but the original debugMode setting that followed me in from the autowire interceptor couldn’t keep up and now I am logging again even thought I wasn’t supposed to be.

I’m tempted to say that the actual logging on lines 426 and 438 of beanFactory.autowire() should just directly look up the debugMode setting in the auto interceptor but I don’t think that is really the correct answer. The beanFactory really stands on its own and just happens to be in use by the autowire interceptor’s preprocessing.

I think the debugMode setting might need to be passed around wherever the flow of code goes in beanFactory no matter how sidetracked it gets on nested dependencies. This sounds like a bit of a pain, but I’m not sure how else to do it.



You are right brad. I will check it since the default debugmode should
be false. Thanks for catching this

Fixes are on SVN, I found more!! :slight_smile: