Console.log does nothing in Firebug in Liferay

I have some debugging fingerprints in my script with console.log(message) , but the messages do not appear in the Firebug console section.

What could be the reason for this?

UPDATE 1

None of console.warn , console.error and console.info work.

UPDATE 2

I have the following log function:

 function log(message) { console.error(message); $("#log").append(message + "<br/>"); } 

therefore, it is registered in both the Firebug console and the DIV on the page. I see that the DIV is working. Consequently, management reaches assertions.

UPDATE 3

- irrelevant -

UPDATE 4

Update 3 didn't matter: consoleBody in firebug.js was not always null. This later became valuable.

But I saw that the contents of consoleBody contains "div # log". Perhaps this interferes with my naming ...

UPDATE 5

Renaming the identifier of my DIV did not help ...

UPDATE 6

I do console.log("hehe") in the immediate firebug line, it prints undefined

UPDATE 7

It appears that console.log() does not work at all in the Liferay portlet; even the very simple hello world portlet does not cancel this command.

+4
source share
7 answers

I'm not sure what the reason for this behavior is for version 6.0, but I found the reason why it does not work in 5.2.3.

It seems Liferay includes Firebug Lite on my page, and when I press F12, it appears at the bottom. It cross-calls console methods.

Now I am looking for the right way to remove the included script.

EDIT: It seems the reason is because I have developer mode enabled.

set JAVA_OPTS =% JAVA_OPTS% -Dexternal-properties = portal-developer.properties

+1
source

Use the javascript.log.enabled=false property. This will disable firebug lite, now console.log will go into the browser console.

+2
source

Try console.info . If this fails, use one of console.warn or console.error .

An option can be set to remove this requirement from Firefox.

0
source

The situation arises when Liferay 6.0 runs under Eclipse. Upgrading Eclipse Liferay Plugin to 1.5 did not help.

You can install a new Liferay installation, run it under Eclipse and try console.log('hehe') in the immediate vicinity of Firebug - it will not work.

But this error does not occur in Liferay 6.1 with Tomcat 7.

0
source

It looks like it was a Liferay 6.0 bug. Log works in Liferay 6.1

0
source

$ ("# log") does not work in Liferay 5.2. The correct syntax (in non-conflict mode) for Liferay is jQuery ("# ​​log"), since they use several js frameworks.

0
source

Someone found a way to completely disable Firebug-Lite by renaming the name dirname webapps / ROOT / html / js / firebug .. It seems to work, but I also did what the SO user "Yogesh Agrawal" suggested in his answer from July 4th at 5:27

See http://www.liferay.com/community/forums/-/message_boards/message/14202657

0
source

Source: https://habr.com/ru/post/1392529/


All Articles