How to log to console when in a Drupal attach behavior? I'm using Drupal 7. I have the following code that tries to log to the console:

function mymodule_get_jquery() {
  $jquery = &lt;&lt;&lt;JAVASCRIPT

  console.log("here");

  (function($) {
    console.log("there");

    Drupal.behaviors.addHighStockChart = {

      attach: function(context, settings) {

        console.log("everywhere");

        /* ... */

      } // end attach
    } // end Drupal.behaviors.addHighStockChart
  }) (jQuery);

JAVASCRIPT;

  return $jquery;
}


If I open the Console in Firefox or Chrome, the log outputs the following:

JQMIGRATE: Migrate is installed, version 1.4.1
here
there


Why isn't the "everywhere" line getting logged? Is there any way to log JavaScript info in the Drupal behavior attach function?

UPDATE:

Here is how I am calling the mymodule_get_jquery() function:

/*
 * Implements hook_page().
 */
function mymodule_page() {

  /* ... */

  $jquery = mymodule_get_jquery();
  drupal_add_js($jquery, "inline");

  /* ... */
}
Drupal object should be passed as function parameter like below:

(function($, Drupal) {
    console.log("there");

    Drupal.behaviors.addHighStockChart = {

      attach: function(context, settings) {

        console.log("everywhere");

        /* ... */

      } // end attach
    } // end Drupal.behaviors.addHighStockChart
  }) (jQuery, Drupal);