[JS] - Moved logging to global scope