local W=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local w=W:WaitForChild("\108\105\098")local Z=require(w:WaitForChild("\080\105\122\122\097\065\108\112\097\099\097"))local d=Z.GameModule:extend("\076\111\103\103\101\114")local a="\091\037\115\093\091\037\115\093\058 \037\115"local p={OUTPUT=1,WARNING=2,SEVERE=3}local o={[p.OUTPUT]="\079\085\084\080\085\084",[p.WARNING]="\087\065\082\078\073\078\071";[p.SEVERE]="\083\069\086\069\082\069"}local c={[p.OUTPUT]=print;[p.WARNING]=warn,[p.SEVERE]=function(W)error(W,3)end}function d.create(W)W.logtype=p end function d.createLogger(w,W)local Z={}Z.logtype=p function Z.log(d,w,Z)Z=Z or p.OUTPUT c[Z or p.OUTPUT](a:format(tostring(W),tostring(o[Z]),tostring(w)))end return Z end return d
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local lib = ReplicatedStorage:WaitForChild("lib")

local PizzaAlpaca = require(lib:WaitForChild("PizzaAlpaca"))

local Logger = PizzaAlpaca.GameModule:extend("Logger")

local LOG_FORMAT_STRING = "[%s][%s]: %s"

local logtype = {
    OUTPUT = 1,
    WARNING = 2,
    SEVERE = 3,
}

local logtypeNames = {
    [logtype.OUTPUT] = "OUTPUT",
    [logtype.WARNING] = "WARNING",
    [logtype.SEVERE] = "SEVERE",
}

local printFuncs = {
    [logtype.OUTPUT] = print,
    [logtype.WARNING] = warn,
    [logtype.SEVERE] = function(msg)
        -- Todo: send this to a webserver so nim can review it
        error(msg,3) -- delicious red text.
    end
}

function Logger:create() -- constructor, fired on instantiation, core will be nil.
    self.logtype = logtype
end

function Logger:createLogger(module)
    local logger = {}
    logger.logtype = logtype

    function logger:log(msg,severity)
        severity = severity or logtype.OUTPUT
        printFuncs[severity or logtype.OUTPUT](LOG_FORMAT_STRING:format(
            tostring(module),
            tostring(logtypeNames[severity]),
            tostring(msg))
        )
    end

    return logger
end

return Logger