GM log: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
Malesca (talk | contribs)
Update for 4.0
 
(29 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{underscore|title=GM_log}}
As of Greasemonkey 4.0, this method has been removed.  
 
You should use the [https://developer.mozilla.org/en-US/docs/Web/API/console.log console] instead.
= 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.
 
 
[[Category:API Reference|L]]

Latest revision as of 15:03, 3 November 2017

As of Greasemonkey 4.0, this method has been removed. You should use the console instead.