Documentation
  • 👋Introduction
  • 📚Guides
    • Useful Links
  • 🆓boii_utils
    • Installation
    • Configuration
    • Modules
    • API
      • Callbacks
      • Characters
      • Commands
      • Cooldowns
      • Debugging
      • Entities
      • Environment
      • Framework Bridge
      • Geometry
      • Items
      • Keys
      • Licences
      • Maths
      • Methods
      • Player
      • Requests
      • Strings
      • Tables
      • Timestamps
      • UI Bridges
      • Vehicles
      • Version
      • XP
      • UI Elements
Powered by GitBook
On this page
  • Accessing the Module
  • Shared
  • get_current_time()
  • print(level, message, data?)
  1. boii_utils
  2. API

Debugging

The Debugging module provides lightweight logging tools with color-coded output and timestamping, useful for both client and server contexts.


Accessing the Module

local DEBUG <const> = exports.boii_utils:get("modules.debugging")

Shared

get_current_time()

Returns the current formatted time string.

Returns

Type
Description

string

Current time in "YYYY-MM-DD HH:MM:SS" format

Example

local time = DEBUG.get_current_time()
DEBUG.print("info", "Current time:", time)

print(level, message, data?)

Logs a formatted message to the console with a colored prefix and optional table data. Automatically detects and prints the name of the invoking resource.

Parameters

Name
Type
Description

level

string

The log level: debug, info, success, warn, error

message

string

The message string to print

data?

table?

Optional table to JSON encode and append to the message

Example

DEBUG.print("info", "Loading complete")
DEBUG.print("error", "Something went wrong", { code = 500, reason = "Bad request" })
PreviousCooldownsNextEntities

Last updated 1 month ago

🆓