From FirebugWiki

Jump to: navigation, search

Turns on logging for all calls to a function.

This means whenever that function is called, a log message will be created inside the Console Panel showing the function name, the parameters and their values.

Logged functions listed within the Breakpoints side panel

When monitor() is called on a function, the monitor is listed within the Breakpoints Side Panel.


[edit] Syntax


[edit] Parameters

[edit] fn

Function to log calls for. (required)

[edit] Examples

Having the following function:

  1. function faculty(n)
  2. {
  3.     if (n==1 || n==0)
  4.         return 1;
  6.     var facNumber = 1;
  7.     for (i = 1; i <= n; i++)
  8.         facNumber *= i;
  10.     return facNumber;
  11. }

This enables logging of calls to the function faculty(). So calling this function like faculty(5), a log message like the following will be created:


[edit] See also

Personal tools