Show raw api
{
"functions": [
{
"name": "new",
"desc": "Constructs a new logger of the given `name` within the given [Logging] module.\nShould not be used directly. Instead, call [Logging:getLogger] or [Logger:getChild] which\nproperly construct the logger hierarchy.",
"params": [
{
"name": "logging",
"desc": "",
"lua_type": "Logging"
},
{
"name": "name",
"desc": "",
"lua_type": "string"
},
{
"name": "parent",
"desc": "",
"lua_type": "[Record]"
}
],
"returns": [
{
"desc": "",
"lua_type": "Logger"
}
],
"function_type": "static",
"since": "0.1.0",
"private": true,
"source": {
"line": 102,
"path": "Logging/Logger.lua"
}
},
{
"name": "getFullName",
"desc": "Returns the names of all ancestors of a logger and the logger's name itself, concatenated by\nperiods, e.g. `MyFightingGame.Players.DataStores`. The value returned by this function can\nbe sent to [Logging:getLogger] to retrieve the same logger.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "string"
}
],
"function_type": "method",
"tags": [
"Hierarchy"
],
"since": "0.1.0",
"source": {
"line": 129,
"path": "Logging/Logger.lua"
}
},
{
"name": "getChild",
"desc": "Gets a child logger with the given name, creating it if it does not exist.\nIf the given name contains a period, the logger returned is the child whose name appears\nafter the period, i.e. `logger:getChild(\"MyFightingGame.Players\")` is the same as\n`logger:getChild(\"MyFightingGame\"):getChild(\"Players\")`",
"params": [
{
"name": "childName",
"desc": "",
"lua_type": "string"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Hierarchy"
],
"since": "0.1.0",
"source": {
"line": 147,
"path": "Logging/Logger.lua"
}
},
{
"name": "setLevel",
"desc": "Sets the lowest level of [Record]s that this logger will emit to its handlers.",
"params": [
{
"name": "level",
"desc": "",
"lua_type": "Level"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 173,
"path": "Logging/Logger.lua"
}
},
{
"name": "getEffectiveLevel",
"desc": "Returns the level of this logger, or if it is [Level.NotSet], the effective level of the [Logger.parent].",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Level"
}
],
"function_type": "method",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 190,
"path": "Logging/Logger.lua"
}
},
{
"name": "isEnabledFor",
"desc": "Returns whether this logger will filter [Record]s with the given [Level] according to its [Logger:getEffectiveLevel].",
"params": [
{
"name": "level",
"desc": "",
"lua_type": "Level"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 201,
"path": "Logging/Logger.lua"
}
},
{
"name": "addFilter",
"desc": "Adds a [Filter] to this logger.",
"params": [
{
"name": "filter",
"desc": "",
"lua_type": "Filter"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 215,
"path": "Logging/Logger.lua"
}
},
{
"name": "removeFilter",
"desc": "Removes a [Filter] from this logger.",
"params": [
{
"name": "filter",
"desc": "",
"lua_type": "Filter"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 226,
"path": "Logging/Logger.lua"
}
},
{
"name": "filter",
"desc": "Checks if the level of the given record using [Logger:isEnabledFor].\nIf it is, each filter added by [Logger:addFilter] is called in turn.\nIf any filter function returns false or nil, this function returns false.\nOtherwise, this function returns true.",
"params": [
{
"name": "record",
"desc": "",
"lua_type": "Record"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 240,
"path": "Logging/Logger.lua"
}
},
{
"name": "addHandler",
"desc": "Adds a [Handler] to this logger. If a function is provided instead, a [FuncHandler] is created to wrap it.",
"params": [
{
"name": "handler",
"desc": "",
"lua_type": "Handler"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Handling"
],
"since": "0.1.0",
"source": {
"line": 258,
"path": "Logging/Logger.lua"
}
},
{
"name": "removeHandler",
"desc": "Removes a [Handler] from this logger. If a function is provided, a [FuncHandler] with the given function is searched for and removed.",
"params": [
{
"name": "handler",
"desc": "",
"lua_type": "Handler"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Handling"
],
"since": "0.1.0",
"source": {
"line": 274,
"path": "Logging/Logger.lua"
}
},
{
"name": "newRecord",
"desc": "Creates a [Record] with the provided arguments.",
"params": [
{
"name": "level",
"desc": "",
"lua_type": "Level"
},
{
"name": "message",
"desc": "",
"lua_type": "RecordMessage"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Record"
}
],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 299,
"path": "Logging/Logger.lua"
}
},
{
"name": "log",
"desc": "Create a [Record] using [Logger:newRecord] with the provided arguments.\nThen, calls [Logger:filter], and if it passes, [Logger:emit]. Returns the\nnewly created record.",
"params": [
{
"name": "level",
"desc": "",
"lua_type": "Level"
},
{
"name": "message",
"desc": "",
"lua_type": "RecordMessage"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Record"
}
],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 314,
"path": "Logging/Logger.lua"
}
},
{
"name": "emit",
"desc": "Invokes each of the logger's [Handler]s with the given [Record]. Then,\nif [Logger.propagate] is true, the record is emit on the [Logger.parent].",
"params": [
{
"name": "record",
"desc": "",
"lua_type": "Record"
}
],
"returns": [],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 329,
"path": "Logging/Logger.lua"
}
},
{
"name": "debug",
"desc": "Invokes [Logger:log] with the level of the record set to [Level.Debug].",
"params": [
{
"name": "message",
"desc": "",
"lua_type": "RecordMessage"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Record"
}
],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 352,
"path": "Logging/Logger.lua"
}
},
{
"name": "info",
"desc": "Invokes [Logger:log] with the level of the record set to [Level.Info].",
"params": [
{
"name": "message",
"desc": "",
"lua_type": "RecordMessage"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Record"
}
],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 365,
"path": "Logging/Logger.lua"
}
},
{
"name": "warning",
"desc": "Invokes [Logger:log] with the level of the record set to [Level.Warning].",
"params": [
{
"name": "message",
"desc": "",
"lua_type": "RecordMessage"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Record"
}
],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 377,
"path": "Logging/Logger.lua"
}
},
{
"name": "error",
"desc": "Invokes [Logger:log] with the level of the record set to [Level.Error].",
"params": [
{
"name": "message",
"desc": "",
"lua_type": "RecordMessage"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Record"
}
],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 390,
"path": "Logging/Logger.lua"
}
},
{
"name": "critical",
"desc": "Invokes [Logger:log] with the level of the record set to [Level.Critical].",
"params": [
{
"name": "message",
"desc": "",
"lua_type": "RecordMessage"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Record"
}
],
"function_type": "method",
"tags": [
"Logging"
],
"since": "0.1.0",
"source": {
"line": 402,
"path": "Logging/Logger.lua"
}
},
{
"name": "wrap",
"desc": "Returns two functions which wrap the built-in `print` and `wrap` globals.\nIf `callOriginal` is true, the original global functions are called after\nlogging.",
"params": [
{
"name": "callOriginal",
"desc": "",
"lua_type": "boolean"
}
],
"returns": [
{
"desc": "",
"lua_type": "function, function"
}
],
"function_type": "method",
"tags": [
"Sugar"
],
"since": "0.1.0",
"source": {
"line": 415,
"path": "Logging/Logger.lua"
}
},
{
"name": "pcall",
"desc": "Works just like the global `pcall`, with the addition of logging an [Level.Error] if the function errors.",
"params": [
{
"name": "func",
"desc": "",
"lua_type": "function"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "any"
}
],
"function_type": "method",
"tags": [
"Sugar"
],
"since": "0.1.0",
"source": {
"line": 446,
"path": "Logging/Logger.lua"
}
},
{
"name": "xpcall",
"desc": "Works just like the global `xpcall`, with the addition of logging an [Level.Error] if the function errors.",
"params": [
{
"name": "func",
"desc": "",
"lua_type": "function"
},
{
"name": "errorHandler",
"desc": "",
"lua_type": "function"
},
{
"name": "...",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "any"
}
],
"function_type": "method",
"tags": [
"Sugar"
],
"since": "0.1.0",
"source": {
"line": 463,
"path": "Logging/Logger.lua"
}
}
],
"properties": [
{
"name": "logging",
"desc": "The logging module in which this logger was created.",
"lua_type": "Logging",
"since": "0.1.0",
"source": {
"line": 28,
"path": "Logging/Logger.lua"
}
},
{
"name": "name",
"desc": "The name of this logger to be considered when working with logger hierarchies.",
"lua_type": "string",
"tags": [
"Hierarchy"
],
"since": "0.1.0",
"source": {
"line": 36,
"path": "Logging/Logger.lua"
}
},
{
"name": "parent",
"desc": "The parent logger whose level shall be deferred to when this logger's level is [Level.NotSet]\n(see [Logger:getEffectiveLevel]). [Records] emit by this logger are emit to the parent logger\nif [Logger.propagate] is true.\n\nLoggers at the top level, e.g. `Logging:getLogger(\"MyModule\")`, have the root logger as their parent.\nThe root logger does not have a parent.",
"lua_type": "Logger",
"tags": [
"Hierarchy"
],
"since": "0.1.0",
"source": {
"line": 49,
"path": "Logging/Logger.lua"
}
},
{
"name": "propagate",
"desc": "Indicates whether records should be handled by the [Logger.parent], if it exists.",
"lua_type": "boolean",
"tags": [
"Hierarchy"
],
"since": "0.1.0",
"source": {
"line": 57,
"path": "Logging/Logger.lua"
}
},
{
"name": "children",
"desc": "Maps the child [Logger.name]s to the child [Logger]s themselves.",
"lua_type": "table",
"tags": [
"Hierarchy"
],
"since": "0.1.0",
"source": {
"line": 65,
"path": "Logging/Logger.lua"
}
},
{
"name": "level",
"desc": "The level of this logger. Use [Logger:getEffectiveLevel] when considering\na logger's level.",
"lua_type": "Level",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 74,
"path": "Logging/Logger.lua"
}
},
{
"name": "filters",
"desc": "A set of [Filter]s added to this logger with [Logger:addFilter].",
"lua_type": "table",
"tags": [
"Filtering"
],
"since": "0.1.0",
"source": {
"line": 82,
"path": "Logging/Logger.lua"
}
},
{
"name": "handlers",
"desc": "A set of [Handler]s added to this logger with [Logger:addHandler].",
"lua_type": "table",
"tags": [
"Handling"
],
"since": "0.1.0",
"source": {
"line": 90,
"path": "Logging/Logger.lua"
}
}
],
"types": [
{
"name": "Filter",
"desc": "A function which accepts a record to consider and returns a boolean indicating whether\nthe record should be processed. It is called by [Logger:filter] and [Handler:filter].",
"lua_type": "(Record) -> (boolean)",
"source": {
"line": 21,
"path": "Logging/Logger.lua"
}
}
],
"name": "Logger",
"desc": "Responsible for creating [Record]s to be filtered and emit to [Handler]s.",
"source": {
"line": 9,
"path": "Logging/Logger.lua"
}
}