WarnService
A reimagined solution to warning text, and more.
API
This powerful resource grants developers an advanced, sophisticated API for scripts to interact with.
Uncover the magical API
WarnService.new(content: any): WarnLogger
Instantiates a brand new WarnLogger instance. Necessary for logging any sort of warning.
content: any- what will be logged as a warning
WarnLogger:Warn(): ()
Logs the desired warning. Acquired from content when the WarnLogger was created.
Since this is a fundamentally lightweight and simple module, I will be releasing the source here and now:
The painfully crafted source, which works perfectly
--!optimize 2
type WarnService = {
new: (any) -> WarnLogger
}
type WarnLogger = {
Warn: () -> ()
}
local WarnLogger = {}
WarnLogger.__index = WarnLogger
function WarnLogger.new(content: any): WarnLogger
local self = {}
self.Content = content
return setmetatable(self, WarnLogger)
end
function WarnLogger:Warn(): ()
warn(self.Content)
end
local WarnService = {}
WarnService.__index = WarnService
function WarnService.new(content: any): WarnLogger
local warnLogger = WarnLogger.new(content)
return warnLogger
end
return WarnService
