Logger Edit
π Overview
The logger module provides a flexible way to integrate custom logging functionality. Located in editable/server/logger.lua
, this module handles both server-side logging and Discord webhook integration.
π§ Core Functions
Basic Logging
--- Log an event to the server
--- @param src number|string Source of the event (player id or "SYSTEM")
--- @param event string Event name/type
--- @param message any Message or data to log
EditableLogger.log(src, event, message)
Discord Webhook Integration
--- Send a log to Discord webhook
--- @param data table Webhook data structure
EditableLogger.logDiscord(data)
π Data Structures
Discord Webhook Data
{
type = 'putPhone', -- Event type
title = 'CHARGING KIOSK', -- Embed title
action = 'Phone Stored', -- Action description
stationId = 'station_1', -- Station identifier
kioskId = 'kiosk_1', -- Kiosk identifier
phoneNumber = '555-0123', -- Phone number
battery = 50, -- Battery level
amount = 100, -- Transaction amount
playerInfo = { -- Player information
source = 1,
license = 'license:xxx',
discord = '<@discordid>'
}
}
βοΈ Customization Tips
Adding New Log Types
Add webhook URL in configuration
Define color code
Create log format
Implement logging call
π οΈ Error Handling
Always check webhook URLs validity
Handle missing configuration gracefully
Validate data structures before logging
Implement fallback logging methods
Integrated by Sahara Scripters - Making logs more interesting than your server chat
Last updated