-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibSFUtils_Global.lua
More file actions
32 lines (29 loc) · 1.03 KB
/
LibSFUtils_Global.lua
File metadata and controls
32 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- This is always the first source file loaded so that
-- it can create the addon table/namespace.
LibSFUtils = {
name = "LibSFUtils",
LibVersion = 63, -- change this with every release!
author = "Shadowfen",
}
--[[
An implementation of a logger which uses the lua print function
to output the messages.
This is an internal-only logger as the LibSFUtils.Createlogger is not yet available (not loaded).
--]]
local printLibDebug = {
Error = function(self,...) print("ERROR: "..string.format(...)) end,
Warn = function(self,...) print("WARN: "..string.format(...)) end,
Info = function(self,...) print("INFO: "..string.format(...)) end,
Debug = function(self,...) print("DEBUG: "..string.format(...)) end,
}
setmetatable(printLibDebug, { __call = function(self, name)
self.addonName = name
return self
end
})
if LibDebugLogger then
LibSFUtils.logger = LibDebugLogger:Create("SFUtils")
LibSFUtils.logger:SetEnabled(true)
else
LibSFUtils.logger = printLibDebug("SFUtils")
end