log.getLoggers

From RPTools Wiki
Jump to navigationJump to search

exampleFunction() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.5.2
Returns a JSON array of available loggers and the current logging level for each.

Usage

log.getLoggers()

Parameters None.

Example

Get a list of available loggers and format the JSON result.
<pre>[r: json.indent(log.getLoggers())]</pre>

Returns:

 1 [
 2         {
 3         "name": "macro-logger",
 4         "level": "ERROR"
 5     },
 6         {
 7         "name": "net.rptools.lib.io.PackedFile",
 8         "level": "ERROR"
 9     },
10         {
11         "name": "net.rptools.maptool.client.swing.AbeillePanel",
12         "level": "ERROR"
13     },
14     ...
15 ]

See Also