GSLog - Scoped, Global
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- API reference
GSLog is a script include that simplifies script logging and debugging by implementing levels of log output, selectable by per-caller identified sys_properties values.
Logs generated using the GSLog API are logged in the System Logs. Specifically, you can find System Logs in the UI by navigating to . You can choose to view all logs or specific log types like Application Logs, Errors, Script Log Statements, and so on under this menu item. Filtering the Source column in the All logs view can help locate your entries faster.
Logs can be at the level of debug, info, notice, warning, err, or crit (after BSD syslog.h and followers). The default logging level is notice, so levels should be chosen accordingly.
Use for any server-side script where you want to implement event logging.
For more information, see Debugging scripts.
GSLog – GSLog()
Instantiates a GSLog object.
Name | Type | Description |
---|---|---|
traceProperty | String | System property that contains a value indicating the level at or above which messages will be written to the log. |
caller | String | Name of the script calling the logger. |
Example
GSLog – debugOn()
Determines if debug is turned on.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | Flag that indicates whether debug is on or off. Valid values:
|
Example
Output:
GSLog – getLevel(String level)
Returns the log level.
Name | Type | Description |
---|---|---|
level | String | Optional. Log level. |
Type | Description |
---|---|
String | Log level. |
Example
Output:
GSLog – initialize(String traceProperty, String caller)
Called by the Prototype JavaScript Framework during object creation to initialize a new instance of this class. Provide the input parameters, but do not call this method directly.
Name | Type | Description |
---|---|---|
traceProperty | String | System property that contains a value indicating the level at or above which messages will be written to the log. |
caller | String | Name of the script calling the logger. |
Type | Description |
---|---|
None |
Example
GSLog – log(String level, String msg)
Logs a message at the specified level.
Name | Type | Description |
---|---|---|
level | String | Log level. |
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
GSLog – logAlert(String msg)
Logs alert events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
Output:
GSLog – logCrit(String msg)
Logs critical events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
Output:
GSLog – logDebug(String msg)
Logs debug events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
Output:
GSLog – logEmerg(String msg)
Logs emergency events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
Output:
GSLog – logErr(String msg)
Logs error events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
Output:
GSLog – logInfo(String msg)
Logs information events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
GSLog – logNotice(String msg)
Logs notice events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
Output:
GSLog – logWarning(String msg)
Logs warning events.
Name | Type | Description |
---|---|---|
msg | String | Message to write to the log. |
Type | Description |
---|---|
None |
Example
Output:
GSLog – setLevel(String level)
Sets the log level.
Name | Type | Description |
---|---|---|
level | String | Log level to set. |
Type | Description |
---|---|
None |
Example
On this page
- GSLog – GSLog()
- GSLog – debugOn()
- GSLog – getLevel(String level)
- GSLog – initialize(String traceProperty, String caller)
- GSLog – log(String level, String msg)
- GSLog – logAlert(String msg)
- GSLog – logCrit(String msg)
- GSLog – logDebug(String msg)
- GSLog – logEmerg(String msg)
- GSLog – logErr(String msg)
- GSLog – logInfo(String msg)
- GSLog – logNotice(String msg)
- GSLog – logWarning(String msg)
- GSLog – setLevel(String level)