Skip to content
GhostglowDev edited this page Mar 21, 2024 · 3 revisions
local dbg = require "ghostutil.debug"

See source code

Variables

  • logs:Array<String> - Stores all the messages from debug.log
  • ver:Array<String> - Stores both version and stage of GhostUtil in a table
  • version:String - Current GhostUtil version
  • stage:String - Current GhostUtil stage
  • checkForUpdates:Bool - Show warnings when the current version of GhostUtil is outdated.

Functions

getLatest(key:Int) -> String

Fetches the latest version/stage of GhostUtil

  • key: 1 for version and 2 for stage

getLatestVersion() -> String

Fetches the latest version of GhostUtil

getLatestStage() -> String

Fetches the latest stage of GhostUtil

checkOutdate() -> Bool

Checks if the current GhostUtil is outdated.

error(message:String, ?ifDebug:Bool = true) -> Void

Prints out an error message (Red Debug Text)

  • message: The error message
  • ifDebug: Only prints the error if luaDebugMode is true (Default: true)

Example:

function noteMiss()
    dbg.error("You suck!", false)
end

warning(message:String, ?ifDebug:Bool = true) -> Void

Prints out a warning message (Yellow Debug Text)

  • message: The warning message
  • ifDebug: Only prints the warning message if luaDebugMode is true (Default: true)

Example:

function onGhostTap()
    dbg.warning("Stop *Ghost* Tapping", false)
end
-- Ahah, get the joke? ok ill stop.

log(message:String, ?ifDebug:Bool = true) -> Void

Logs the message in a table logs

  • message: Message to log
  • ifDebug: Only prints the log message if luaDebugMode is true (Default: true)

Example:

function goodNoteHit()
    dbg.log("You gud", false)
end

function opponentNoteHit()
    debugPrint(dbg.logs())
end