GM log: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
Line 22: Line 22:


  GM_log("Hello, World!");
  GM_log("Hello, World!");
GM_log("Hello " + someInputField.value);


= Notes =
= Notes =

Revision as of 10:59, 24 February 2007

Template:Underscore

Syntax

GM_log( message, level )

Description

Allows script authors simple access to logging informational messages in the Error Console. This can be helpful for debugging.

The message string is required.

The level is optional and defaults to 0. Valid values are:

0
info
1
warning
2
error

Examples

GM_log("Hello, World!");
GM_log("Hello " + someInputField.value);

Notes

GM_log is available in Greasemonkey version 0.3 and later.