log.getLoggers

From RPTools Wiki
Revision as of 22:33, 9 February 2023 by Conversion script (talk | contribs) (Conversion script moved page log.getLoggers to Log.getLoggers without leaving a redirect: Converting page title to first-letter uppercase)
Jump to navigation Jump 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:

[
        {
        "name": "macro-logger",
        "level": "ERROR"
    },
        {
        "name": "net.rptools.lib.io.PackedFile",
        "level": "ERROR"
    },
        {
        "name": "net.rptools.maptool.client.swing.AbeillePanel",
        "level": "ERROR"
    },
    ...
]

See Also