lia.log
Logging helper functions.
Predefined flags:
FLAG_NORMAL
FLAG_SUCCESS
FLAG_WARNING
FLAG_DANGER
FLAG_SERVER
FLAG_DEV
Functions
add(client, logType, ...)
Add a log message.
Parameters
-
client
Player
Player who instigated the log
-
logType
String
Log category
-
...
Arguments to pass to the log
addRaw(logString, shouldNotify, flag)
Adds a raw log string to the log system and optionally notifies admins.
Parameters
-
logString
String
The raw log string to add
-
shouldNotify
Boolean
Whether to notify admins about this log (default: false)
-
flag
String
optional
The flag associated with the log
addType(logType, func, category, color, PLogs)
Adds a log type.
Parameters
-
logType
String
Log category
-
func
Function
format callback function(client, ...)
-
category
String
Log category
-
color
Color
optional
Log color
-
PLogs
String
PLogs PLogs compatibility category
Example Usage
function(client, ...) log format callback
getString(client, logType, ...)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Retrieves a formatted log string based on the specified log type and additional arguments.
Parameters
-
client
Player
The client for which the log is generated
-
logType
String
The type of log to generate
-
...
Additional arguments to be passed to the log generation function
Returns
-
any
The formatted log string, its category, and color
loadTables()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Creates directories for storing logs.
send(client, logString, flag)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Sends a log message to a specified client.
Parameters
-
client
Player
The client to whom the log message will be sent.
-
logString
String
The log message to be sent.
-
flag
String
optional
A flag associated with the log message.