lahmatiy/component-inspector

Addition information in logInfo

tenorok opened this issue · 7 comments

Hello and thank you for this amazing inspector!

I try to integrate it into our project and faced with necessity to add some information into console.log(), which printing at:

logInfo: function(){
global.$component = {
node: selectedDomNode.value,
instance: selectedInstance.value
};
console.log($component);
}

Is it possible?

And just one more question.
Can I add determine to templates? For example, create one more link to here:

<span class="log__link" event-click="logInfo" title="Output view in console save it as $component">console.log(info)</span>

What sort of information you want to add? Probably we can add extra API method to customise information for console.log() or even override logInfo method logic.

Can I add determine to templates? For example, create one more link to here:

I guess you can. But I need to know what problem are you solving. Probably will be suitable to override info panel rendering at all.
Keep in mind, that backbone and react integrations are merely examples. You can hack inspector as you want. But if you see some ways for improvements that can be halpful for others - let's extend basic functionality.

In our project we using BEM and opportunity to print entering BEMJSON-tree would be helpfully. Somiteimes this tree is very big, what the reason that printing him in the component-popup is uncomfortable.

I suppose you use API free build, I'm right? If we add extra methods to customize console output does it solve the problem?
Another possible solution is add custom panel (with overflow) to Inspector sidebar. Are you sure it's not suitable?

Yes, we use API free build.
Customizable console output will solve our problem in whole. And I think, that it would be useful for any other needs in the future.
Custom panel – interesting thing and it is can solve our problem too. But I'm afraid, that it will hard in realization and inspector may become monstrous due so bulky interface.

Component Inspector 1.3.0 is out. It has new methods to customize logging and helpers to create custom info sections (see Custom info sections).
I believe it meets your needs ;)

Cool and so fast! Thank you :-)