// from above, but we turn anround and pass it to our embedded compiler as the "main" helper.
}
private Logger setLogAdapter(CompilationUnit unit)
{
Logger original = ThreadLocalToolkit.getLogger();
if (mxmlConfiguration.getGenerateAbstractSyntaxTree())
{
Logger adapter = new AbstractSyntaxTreeLogAdapter(original);
ThreadLocalToolkit.setLogger(adapter);
}
else
{
LineNumberMap map = (LineNumberMap) unit.getContext().getAttribute(MxmlCompiler.LINE_NUMBER_MAP);
MxmlLogAdapter adapter = new MxmlLogAdapter(original, map);
adapter.addLineNumberMaps(unit.getSource().getSourceFragmentLineMaps());
ThreadLocalToolkit.setLogger(adapter);
}
return original;
}