If you want to print the log messages inside the window container’s body, it is possible to declare the panel there:
var console = {
panel: $(parent.document.body).append('<div>'),
log: function(m){
this.panel.prepend('<div>'+m+'</div>');
}
};
console.log('message');