Skip to content

(Logger):extend

Builds upon an existing logger object to make a 'chained' name to appear within the logs.

For example, the default behaviour is to 'chain' left-to-right, [a:b:c] with each name appearing in the chosen color.

Synopsis

logger = Logger:extend( name, color )

Parameters

name string
Identifier shown in the logs.
color color ("white")
Color used to highlight the name in consoles that support color highlighting.

Returns

logger logger
A new object of a logger.

Examples

local a = Logger:extend("a")

local b = a:extend("b", "blue")

local c = c:extend("c", { fg = "white", bg = "blue" })

See Also