Module lege.log

Logging facilities for LEGE programs.

This module uses SDL's logging facilities to write log messages to the appropriate place for each platform.

Usage:

    local log = require "lege.log"
    
    log.info("Log priority is currently set to " .. log.get_priority())
    log.verbose("So you won't see this")
    log.set_priority("verbose")
    log.info("Log priority is now set to " .. log.get_priority())
    
    log.verbose("The game's still running")
    log.debug("Starting frobnication process ...")
    log.info("Logged in as xx_DankMemer69_xx")
    log.warn("That username is stupid")
    log.error("The server rejected your username, as it is too stupid")
    log.critical("Cannot continue with a user this stupid")
    
    local msg_type = "info"
    log.message(msg_type, "Yes, we're talking about *you*")
    

Functions

get_priority () Get the lowest log priority at which log messages are output.
set_priority (priority) Set the lowest log priority at which log messages are output.
message (priority, message) Log a message at the specified priority.
verbose (message) Log a message at the verbose priority.
debug (message) Log a message at the debug priority.
info (message) Log a message at the info priority.
warn (message) Log a message at the warn priority.
error (message) Log a message at the error priority.
critical (message) Log a message at the critical priority.


Functions

get_priority ()
Get the lowest log priority at which log messages are output.

Returns:

    string The current SDL log priority

See also:

set_priority (priority)
Set the lowest log priority at which log messages are output.

Parameters:

  • priority string The new SDL log priority

Raises:

if priority is not a valid log message priority

See also:

message (priority, message)
Log a message at the specified priority.

Parameters:

  • priority string The priority of the log message
  • message string The message to log

Raises:

if priority is not a valid log message priority

See also:

verbose (message)
Log a message at the verbose priority.

Parameters:

  • message string The message to log

See also:

debug (message)
Log a message at the debug priority.

Parameters:

  • message string The message to log

See also:

info (message)
Log a message at the info priority.

Parameters:

  • message string The message to log

See also:

warn (message)
Log a message at the warn priority.

Parameters:

  • message string The message to log

See also:

error (message)
Log a message at the error priority.

Parameters:

  • message string The message to log

See also:

critical (message)
Log a message at the critical priority.

Parameters:

  • message string The message to log

See also:

generated by LDoc 1.5.0 Last updated 2024-06-16 21:08:39