mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
refactor(server/logger): remove text formatting from hostname (#361)
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
local service = GetConvar('ox:logger', 'datadog')
|
||||
local hostname = GetConvar('sv_projectName', 'fxserver')
|
||||
local buffer
|
||||
local bufferSize = 0
|
||||
|
||||
local function removeColorCodes(str)
|
||||
-- replace ^[0-9] with nothing
|
||||
str = string.gsub(str, "%^%d", "")
|
||||
|
||||
-- replace ^#[0-9A-F]{3,6} with nothing
|
||||
str = string.gsub(str, "%^#[%dA-Fa-f]+", "")
|
||||
|
||||
-- replace ~[a-z]~ with nothing
|
||||
str = string.gsub(str, "~[%a]~", "")
|
||||
|
||||
return str
|
||||
end
|
||||
|
||||
local hostname = removeColorCodes(GetConvar('ox:logger:hostname', GetConvar('sv_projectName', 'fxserver'))
|
||||
|
||||
local b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
|
||||
local function base64encode(data)
|
||||
|
||||
Reference in New Issue
Block a user