Use of console

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Use of console


I have been noticing that there are more and more console warnings and
errors in GeoNetwork that are hidden to the user. In fact, only on
pure GeoNetwork code we have close to a hundred of this kind of

$ rgrep "console." web-ui/src/main/resources/catalog | grep -v "/lib" | wc -l

This is not a bad practice itself, but it can be a bad practice if we
use it without any warning to the final user. Sometimes, an error
happens and the final user has no clue what was wrong. Maybe an error
or warning message will not fix the problem, but sometimes some more
information can give some indication to the user. Specially if the
problem is between the chair and the keyboard :)

Please, be careful when you use console.log, console.warn or
console.error and always try to leave some trace on the user

Let me remind you that we have an alert service that works quite well:

Just add it as a dependency to your angular service or controller and
use it like this:

             msg: '$MESSAGE'
             type: '$LEVEL'
           }, $MILISECONDS_TO_BE_SHOWN);


$LEVEL can be "info", "success", "warning" or "danger".

Have a happy day!

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
GeoNetwork-devel mailing list
[hidden email]
GeoNetwork OpenSource is maintained at