Skip to main content

debugLoggerUtil

A simple utility module for debug logging.

debugLoggerUtil.log(warn, "test") 

Functions

toggleLoggingEnabledGlobal

debugLoggerUtil.toggleLoggingEnabledGlobal(toggleboolean) → ()

Toggles if logging is enabled or not globally.

debugLoggerUtil.toggleLoggingEnabledGlobal(false)
debugLoggerUtil.log(warn, "test") -- Doesn't do anything

toggleLoggingEnabled

debugLoggerUtil.toggleLoggingEnabled(toggleboolean) → ()

Toggles if logging is enabled or not for the script.

debugLoggerUtil.toggleLoggingEnabled(false)
debugLoggerUtil.log(warn, "test") -- Doesn't do anything

-- In another script..
debugLoggerUtil.log(warn, "123") -- Works

log

debugLoggerUtil.log(
logFunction(...any) → (),
...any
) → ()

Calls logFunction passing in ... to it -- if logging is not enabled, nothing happens.

NOTE

If logging is toggled off for the script (in which this method is called in) or logging is toggled off globally, then this method will not anything.

Show raw api
{
    "functions": [
        {
            "name": "toggleLoggingEnabledGlobal",
            "desc": "Toggles if logging is enabled or not *globally*.\n\n```lua\ndebugLoggerUtil.toggleLoggingEnabledGlobal(false)\ndebugLoggerUtil.log(warn, \"test\") -- Doesn't do anything\n```",
            "params": [
                {
                    "name": "toggle",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 24,
                "path": "src/debugLoggerUtil/init.luau"
            }
        },
        {
            "name": "toggleLoggingEnabled",
            "desc": "Toggles if logging is enabled or not for the *script*.\n\n```lua\ndebugLoggerUtil.toggleLoggingEnabled(false)\ndebugLoggerUtil.log(warn, \"test\") -- Doesn't do anything\n\n-- In another script..\ndebugLoggerUtil.log(warn, \"123\") -- Works\n```",
            "params": [
                {
                    "name": "toggle",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 40,
                "path": "src/debugLoggerUtil/init.luau"
            }
        },
        {
            "name": "log",
            "desc": "Calls `logFunction` passing in `...` to it -- if logging is not enabled, nothing happens. \n\n:::note\nIf logging is toggled off for the script (in which this method is called in) or logging is toggled\noff *globally*, then this method will not anything.\n:::",
            "params": [
                {
                    "name": "logFunction",
                    "desc": "",
                    "lua_type": "(...any) -> ()"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 54,
                "path": "src/debugLoggerUtil/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "debugLoggerUtil",
    "desc": "A simple utility module for debug logging.\n\n```lua\ndebugLoggerUtil.log(warn, \"test\") \n```",
    "source": {
        "line": 10,
        "path": "src/debugLoggerUtil/init.luau"
    }
}