Difference between revisions of "GM log"

From GreaseSpot Wiki
Jump to navigationJump to search
(Removed level argument - apparently not supported, see discussion.)
(Symmetry update)
Line 1: Line 1:
{{underscore|title=GM_log}}
{{underscore|title=GM_log}}
__NOTOC__


= Syntax =
== Description ==
 
This [[API_reference|API]] method allows script authors simple access to logging informational messages in the Error Console.
 
If you aren't seeing your messages, make sure you navigate to [[mozillazine:About:config|about:config]], and change the values of <code>javascript.options.showInConsole</code> and <code>javascript.options.strict</code> to true. This can be helpful for debugging.
 
[[#Examples|Examples]] | [[#GM_log_and_Firebug|GM_log and Firebug]] | [[#Notes|Notes]]
 
== Syntax ==


'''GM_log(''' ''message'' ''')'''
'''GM_log(''' ''message'' ''')'''


= Description =
:Value: Function
:Returns: Nothing
:Compatibility: [[Version_history#0.3_beta|Greasemonkey 0.3b+]]


Allows script authors simple access to logging informational messages in the Error Console.
:{| border="1" cellpadding="5"
This can be helpful for debugging.
|+ Parameters
!|'''Properties'''
|-
| <code>[[#message |message]]</code>
|}
:* All properties are optional except [[#message|message]].


The ''message'' string is required.
[[#Description|top]]
=== Properties ===
----
==== <code>message</code> ====
:Value: String
:Usage: <code>'''message''' = "ARGHHH!";</code>


= Examples =
:* Message to send to the JavaScript error console.


[[#Description|top]] | [[#Syntax|back]]''
== Examples ==
<code><pre>
  GM_log("Hello, World!");
  GM_log("Hello, World!");
GM_log("Warning, " + someInputField.value + "!");
</pre></code>
 
<code><pre>
GM_log("Warning, " + someInputField.value + "!");
</pre></code>
 
[[#Description|top]]


= Notes =
== GM_log and Firebug ==
Since [https://addons.mozilla.org/en-US/firefox/addon/1843 Firebug] 1.0, <code>extensions.firebug.showChromeMessages</code> must be set to <code>true</code> for GM_log messages to show up in the Firebug console.


GM_log is available in [[Greasemonkey]] version 0.3 and later.
[[#Description|top]]


= GM_log and Firebug =  
== Notes ==
Since Firebug 1.0, extensions.firebug.showChromeMessages must be set to true for GM_log messages to show up in the Firebug console.


[[Category:API Reference|L]]
[[#Description|top]]
[[Category:API_Reference|G]]

Revision as of 01:38, 7 December 2007

Template:Underscore


Description

This API method allows script authors simple access to logging informational messages in the Error Console.

If you aren't seeing your messages, make sure you navigate to about:config, and change the values of javascript.options.showInConsole and javascript.options.strict to true. This can be helpful for debugging.

Examples | GM_log and Firebug | Notes

Syntax

GM_log( message )

Value: Function
Returns: Nothing
Compatibility: Greasemonkey 0.3b+
Parameters
Properties
message
  • All properties are optional except message.

top

Properties


message

Value: String
Usage: message = "ARGHHH!";
  • Message to send to the JavaScript error console.

top | back

Examples

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

top

GM_log and Firebug

Since Firebug 1.0, extensions.firebug.showChromeMessages must be set to true for GM_log messages to show up in the Firebug console.

top

Notes

top