log

Methods

add

Creates and displays a log entry under the provided key

function log.add(key: string, ...): void
-- example usage
log.add("123", "This is an example '123' log entry")

add_info

Creates and displays a log entry under the Inf key

function log.add_info(...): void
-- example usage
log.add_info("This is an example 'Inf' log entry")

add_error

Creates and displays a log entry under the Err key

function log.add_error(...): void
-- example usage
log.add_error("This is an example 'Err' log entry")

add_warning

Creates and displays a log entry under the Wrn key

function log.add_warning(...): void
-- example usage
log.add_warning("This is an example 'Wrn' log entry")

add_success

Creates and displays a log entry under the Suc key

function log.add_success(...): void
-- example usage
log.add_success("This is an example 'Suc' log entry")

new_key

Creates a new key with the provided parameters

function log.new_key(key: string, red: float, green: float, blue: float, visible: bool): void
-- example usage
log.new_key("123", 1.0, 1.0, 1.0, true)

has_key

Returns true if the key exists

function log.has_key(key: string): bool
-- example usage
local exists = log.has_key("123")

clear_key

Clears all log entries under the provided key

function log.clear_key(key: string): void
-- example usage
log.clear_key("123")

delete_key

Clears all log entries under the provided key and disposes of it

function log.delete_key(key: string): void
-- example usage
log.delete_key("123")

set_key_colour

Sets the colour of the provided key

function log.set_key_colour(key: string, red: float, green: float, blue: float): void
-- example usage
log.set_key_colour("123", 1.0, 1.0, 1.0)

get_key_colour

Gets the colour of the provided key

function log.get_key_colour(key: string): float, float, float
-- example usage
local r, g, b = log.get_key_colour("123")

set_key_visibility

Sets the visibility of the provided key

function log.set_key_visibility(key: string, visible: bool): void
-- example usage
log.set_key_visibility("123", true)

get_key_visibility

Gets the visibility of the provided key

function log.get_key_visibility(key: string): bool
-- example usage
local visible = log.get_key_visibility("123")